ironpython3 icon indicating copy to clipboard operation
ironpython3 copied to clipboard

Support modifier spans in re

Open slozier opened this issue 2 years ago • 1 comments

For example:

assert re.match('(?i)g(?-i:v)r', "GVR") is None

Modifier spans are used by the string module in 3.6.

See https://docs.python.org/3/whatsnew/3.6.html#re

slozier avatar Apr 24 '22 19:04 slozier

https://github.com/IronLanguages/ironpython3/pull/1466 partially resolves this by letting the expression flow through to the .NET regex engine which supports imnsx (see Regular Expression Options).

However there are still some failures such as:

re.match(r'(?-x: a) b', ' ab', re.VERBOSE)

slozier avatar May 21 '22 20:05 slozier