Hi Jan,

On 09/19/14 09:38, Jan Seidel wrote:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like *(.*)GUIDE_(?!MIB)(.*)(?!P4)*
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

No, the regex can consume "GUIDE_P4" using "GUIDE_(.*)" which is then not followed by "P4" and so is true. I am not aware of any way to write /one/ expression to do what you want. You need a separate test for excluding names with "P4" at the end.


My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: *(.*)GUIDE_(.*)(?!P4)*
The list is then completely emtpy.

That is strange since it should match all names containing "GUIDE_". I am unsure of the context, but your code should be something like this pseudo code:

if ( name != /P4$/ ) {
  println name;
}

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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to