Lookahead assertions are not working in the service name of a rule

Hi

I’m trying to use a rule in order to assign an icon to those service names which start with http and not end in wsdl (Icon image for services in status GUI ruleset). I tried

http.*(?!wsdl)$

but it assigns the icon even to ones ending with wsdl. As far as I know looahead assertions are valid in Python regular expressions.

Why does it not work?

Best regards

Try a negative lookbehind assertion:

http.*(?<!wsdl)$

It means “end-of-string” not preceeded by wsdl while yours means “any-characters” not followed by wsdl. I think in this case the .* already gobbles up all characters, including wsdl and that wsdl is not followed by another wsdl, so it matches (no matter if the string ends in wsdl or not).

The negative lookbehind assertion on the other hand explicitely forbids that the end-of-string is preceeded by wsdl.

2 Likes

Thanks

http.*(?<!wsdl)$

does work as expected.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.