GUIDE_(?!MIB)(FOO|BAR|BAZ)(?!P4)$ is a nice idea. I have been working with it quite at the beginning of my test cases but I neglected ^ and $. This may be the hint I needed to anchor the parttern. :)
Cheers Am Freitag, 19. September 2014 12:20:49 UTC+2 schrieb Gunnar Strand: > > > On 09/19/14 11:44, Jan Seidel wrote: > > Yay, got it. > A set of projects rules. each one containing a positve match and then > combine the rule works well. > > One odd thing I learned is, that you don't need wildcards if your match > has a trailing string. > > e.g. *MB**_GUIDE**_Pxxxxxxx_P4**_DELIVERY* will also be found when you > work with *(.*)GUIDE_(.*)P4* > > You can by the way combine RegEx like this* > (.*)GUIDE_MIB(.*)|(.*)GUIDE_(.*)P4 *the pipe "|" works well one positive > matches. negative matches don't make fun with it > > > The "^" and the "$" commands matches the beginning of the string and the > end of the string, respectively. Some parsers, or rather some designers, > adds these commands to the pattern, ie "GUIDE_.*P4" would actually be > "^GUIDE_.*P4$" and would not match "MB_GUIDE_P4" nor "GUIDE_P4_DELIVERY". > > However, that does *not* appear to the case above, which is why your > pattern matches the "P4_DELIVERY" name above. You need to add "^" and "$" > yourself if you want to include "starts with" and "ends with" parts for the > pattern. > > If you know which text the '.*' will match, then you could do this: > > GUIDE_(?!MIB)(FOO|BAR|BAZ)(?!P4)$ > > This should match any name containing GUIDE_, where GUIDE_ is not followed > by MIB, and then followed by one of a specific list of possible strings, > which are not followed by "P4". Remove the "$" at the end if the name may > contain other text after the FOO/BAR/BAZ part. > > BR > Gunnar > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.