But according to the python module regex (?i) is a scoped flag not a global flag. Which is why the regex module works with no pattern change required.
It is only the internal python module re that seems to think (?i) is a global flag.
I am not sure which of the two is even correct. But the more I think about it ...
you should be able to turn on ignore case, and back to fullcase inside any pattern so I think regex is correct here and the python module re is incorrect.
ignore case should be a scoped flag. So this is either a bug in the internal python module re or a limitation that is not documented.
Last edited by KevinH; 12-11-2024 at 01:55 PM.
|