Steven D'Aprano wrote:
_t1 = re.compile(r"(\d)\1")  # compile-time
_t2 = re.compile(r"(\s)\1")  # compile-time
re.compile(_t1.pattern + _t2.pattern)  # run-time

It would be weird if p"(\d)\1" + p"(\s)\1" worked but
re.compile(r"(\d)\1") + re.compile(r"(\s)\1") didn't.

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to