compat_getpass,
compat_http_client,
compat_os_name,
+ compat_Pattern,
compat_str,
compat_urllib_error,
compat_urllib_parse_unquote,
base_url,
bug_reports_message,
clean_html,
- compiled_regex_type,
determine_ext,
determine_protocol,
dict_get,
In case of failure return a default value or raise a WARNING or a
RegexNotFoundError, depending on fatal, specifying the field name.
"""
- if isinstance(pattern, (str, compat_str, compiled_regex_type)):
+ if string is None:
+ mobj = None
+ elif isinstance(pattern, (str, compat_Pattern)):
mobj = re.search(pattern, string, flags)
else:
for p in pattern: