Python gems of my own (via) Did you know you can pass 128 as a flag to Python’s re.compile() function to spit out a parse tree? I didn’t. re.compile(“pattern”, 128)
Python gems of my own (via) Did you know you can pass 128 as a flag to Python’s re.compile() function to spit out a parse tree? I didn’t. re.compile(“pattern”, 128)
I went and looked this up once, and found it's not actually Python; the "re" module is a passthrough/wrapper around the SRE library, which is what implements this flag (as, IIRC, a debugging tool).
The 128 is also known as re.DEBUG