-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Defining a filter based on regexes, i.e. using re/from_re/to_re, assumes a string
is passed in. runtest then uses re.compile on the string to create the regex object.
I think this should be extended to allow passing a regex object (that is, the result of re.compile)
directly.
As as example, to match "Foo" case-insensitive the following currently works:
regex = r'(?i)Foo'
get_filter(re=regex, ...)see: https://docs.python.org/3/library/re.html#regular-expression-syntax
The following does not, but I think it should:
regex = re.compile('Foo', re.I)
get_filter(re=regex, ...)especially because passing flags modifying regexes looks less obscure.
Metadata
Metadata
Assignees
Labels
No labels