Is there any way to decompile a regular expression once compiled?
Compiled regular expression objects have a "pattern" attribute which gives the original text pattern.
>>> import re
>>> regex = re.compile('foo (?:bar)*')
>>> regex.pattern
'foo (?:bar)*'
r = re.compile('some[pattern]');
print r.pattern
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With