Jan Seidel (2014-07-22 14:06):
Hi friends,

I am struggling with regular expressions and they drive me atm to Nutsville!

There is a set of jobs and they look like this:
GUIDE_DISPATCHER
GUIDE_CB_xxx_P4
MB_GUIDE_HEAD
MB_GUIDE_PAG_P4
MB_GUIDE_MIB_D_BILBAO

I am now trying to remove the view of everything that either has an MIB or a P4 in the name.
Note MIB is located in the string, P4 always at the end

Output should be:
GUIDE_DISPATCHER
MB_GUIDE_HEAD

Output is:
GUIDE_DISPATCHER
*GUIDE_CB_xxx_P4*
MB_GUIDE_HEAD
*MB_GUIDE_PAG_P4*

I have tested a tremendous amount of different expressions but I am never able to find the matching one. My problem is that jobs ending on P4 simply cannot be removed. Including works but excluding not :(

This regex looks to me like the most reasonable tto work but nope, it isn't.....*(.*)GUIDE_(?!MIB)(.*)(?!P4) *

Use "MB_GUIDE_MIB_D_BILBAO".match("your regexp") to test.

AFAIK "?!" won't work like you expect. I don't think you will be able to do a negative match but you can try ;-).

Regards,
Nux.

--
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.

Reply via email to