[issue12870] Regex object should have introspection methods
report at bugs.python.org
Wed Sep 7 07:03:04 CEST 2011
Matt Chaput <matt at whoosh.ca> added the comment:
Ezio, no offense, but I think it's safe to say you've completely misunderstood this bug. It is not about "explaining what a regex matches" or optimizing the regex. Read the last sentences of the two paragraphs explaining the proposed methods for the use cases. This is about allowing MY CODE to programmatically get certain information about a regex object to allow it to limit the number of times it has to call regex.match(). AFAIK there's no good way to get this information about a regex object without adding these methods or building my own pure-Python regex interpreter, which would be both Herculean and pointless.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list