Another bug discovered with Topy (https://github.com/intgr/topy). When using negative lookbehind with an expression containing
| then it seems it's ignored entirely:
In : import regex In : regex.match('foo(?<!foo|x)', 'foo') Out: <regex.Match object; span=(0, 3), match='foo'>
But I think it should be equivalent to the following regex, which works as I expect:
In : regex.match('foo(?<!foo)(?<!x)', 'foo') Out: None
Using Python 3.5.1, 64-bit on OS X, from HomeBrew.
Also works correctly with built-in
In : import re In : re.match('foo(?<!foo|fox)', 'foo') OUt: None