[Python-ideas] Improving Clarity of re Module

Alex Seewald seewalker.120 at gmail.com
Tue Nov 26 23:31:09 CET 2013


For a match object, m, m.group(0) is the semantics for accessing the entire
span of the match. For newcomers to regular expressions who are not
familiar with the concept of a 'group', the name group(0) is
counter-intuitive. A more natural-language-esque alias to group(0), perhaps
'matchSpan', could reduce the time novices spend from idea to working code.
Of course, this convenience would introduce a bit of complexity to the
codebase, so it may or may not be worth it to add an alias to group(0).
What do people think?

-- 
Alex Seewald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131126/0ff4c0b4/attachment.html>


More information about the Python-ideas mailing list