J
Jelle Smet
Hi List,
I'm trying to match lines in python using the re module.
The end goal is to have a regex which enables me to skip lines which have ok and warning in it.
But for some reason I can't get negative lookaheads working, the way it's explained in "http://docs.python.org/library/re.html".
Consider this example:
Python 2.6.4 (r264:75706, Nov 2 2009, 14:38:03)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.<_sre.SRE_Match object at 0xb75b1598>
I would expect that this would NOT match as it's a negative lookahead and warning is in the string.
Thanks,
I'm trying to match lines in python using the re module.
The end goal is to have a regex which enables me to skip lines which have ok and warning in it.
But for some reason I can't get negative lookaheads working, the way it's explained in "http://docs.python.org/library/re.html".
Consider this example:
Python 2.6.4 (r264:75706, Nov 2 2009, 14:38:03)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.<_sre.SRE_Match object at 0xb75b1598>
I would expect that this would NOT match as it's a negative lookahead and warning is in the string.
Thanks,