On 2020-09-28 at 23:10:24 -0000,
Giang Le <[email protected]> wrote:
> I would like to propose an idea for the regular expression module
> re.search(Pattern, Input) to support List[str] input type.
> So it will return a matched object list if the input is a string
> list. Otherwise, it will return a normal matched object, if the input
> is a normal string
How would that change be better than a new function:
def regex_search_list(regex, pattern, list_of_inputs):
[regex.search(pattern, input) for input in list_of_inputs]
(or possibly an equivalent method of regexen)?
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/QSOAHKIKTJMYEWT24L6NTYIXSFLPT5LP/
Code of Conduct: http://python.org/psf/codeofconduct/