You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python's documentation for the re.match function is match(pattern,
string, [flags]) where pattern can be either a regex string or a
compiled regex object. If it's a compiled regex object, then supplying
an optional flag to re.match (in my case, re.IGNORECASE) doesn't work
and, more to the point, fails silently. I think this should throw an
exception if it's not going to work.
A possible change (proposed by effbot) is below:
Index: re.py
===================================================================
--- re.py (revision 52330)+++ re.py (working copy)@@ -224,6 +224,7 @@
return p
pattern, flags = key
if isinstance(pattern, _pattern_type):
+ assert not flags
return pattern
if not sre_compile.isstring(pattern):
raise TypeError, "first argument must be string or compiled
pattern"
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: