would rather it took List[str] patterns instead, for matching against List[str] input. so you could do things like:
pattern = ["foo", "?", "\", "?", "bar", "baz"] input = ["foo", "?", "bar", "baz"] # matches input = ["?", "bar", "baz"] # matches input = ["foo?barbaz"] # doesn't match bonus points if it also takes arbitrary objects: pattern = [None, True, False, "?"] input = [None, True] # matches input = [None, False] # doesn't match input = [None, True, False] #matches On 2020-09-28 8:10 p.m., Giang Le wrote: > Hi Everyone, > > 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 > > Best Regards > Giang > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/4LOOP2FDK7JQ7XU3Z4Y7JNLOOW5FQOHH/ > Code of Conduct: http://python.org/psf/codeofconduct/ _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/QI2QWN7PO7D5JXQ4VPITDTUWCX7SIVZ2/ Code of Conduct: http://python.org/psf/codeofconduct/