B
Brad Tilley
Is there a quick way to make re.compile show what it's looking for?
x = re.compile('[a-z]')
x = re.compile('[a-z]')
Brad said:Is there a quick way to make re.compile show what it's looking for?
x = re.compile('[a-z]')
>>> import re
>>> x = re.compile('[a-z]')
>>> x.pattern '[a-z]'
>>> import sre_parse # undocumented internal module
>>> sre_parse.parse(x.pattern) [('in', [('range', (97, 122))])]
>>>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.