make regex_search_string match expected behaviour
parent
d655f3e5de
commit
221b0c30fd
|
@ -13,9 +13,9 @@ def regex_search_string(regexes, string, default=None):
|
|||
if not isinstance(regexes, list):
|
||||
regexes = [regexes]
|
||||
for regex in regexes:
|
||||
match = re.match(regex, string)
|
||||
match = re.search(regex, string)
|
||||
if match:
|
||||
return match
|
||||
return match.group(1)
|
||||
return default
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue