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?
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.
--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
True (.*) is very greedy, but (?!P4) is a but not P4 and I would expect it to work.
It isn't as I just figured out in a test run with a completely different RegEx to skim for other jobs :/
I got to tweak it and create a set of project rules and then combine them for each user depending on what they need to know *geesh*
Thanks for the hint.
Jan
Am Freitag, 19. September 2014 09:38:17 UTC+2 schrieb Jan Seidel: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?
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.
Can someone tell me where I glitch?
Cheers
Jan
--
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
Am Freitag, 19. September 2014 09:38:17 UTC+2 schrieb Jan Seidel: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?
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.
Can someone tell me where I glitch?
Cheers
Jan
--
--
--