In [13]: v = Regex("foobar", multiline=True)
In [14]: v.flags
Out[14]: [8] # As expected
In [16]: v = Regex("/foobar/i")
In [17]: v.flags
Out[17]: [] # WTF?
In [18]: v = Regex("/foobar/i", multiline=True)
In [19]: v.flags
Out[19]: [] # WTF?!?!
It appears that providing an ECMA regex will actually cause the library to ignore any flags provided in any way.
This is clearly a bug, and in direct contradiction to the documentation which state that:
Note, that if given pattern is ECMA regex, given flags will be
completely ignored and taken from given regex.
Simply put:
It appears that providing an ECMA regex will actually cause the library to ignore any flags provided in any way.
This is clearly a bug, and in direct contradiction to the documentation which state that: