> What's more, it's a tool that should be used
> with considerable reluctance, because REs are essentially unreadable,
> so every time you use one you're creating a maintenance headache.
Well, it requires some experience to read REs, I have written many, and I
still need to test thoroughly even
I don't see a justification for baking REs into the syntax of Python.
In the Python world, REs are just one tool in a toolbox containing
a great many tools. What's more, it's a tool that should be used
with considerable reluctance, because REs are essentially unreadable,
so every time you use
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