[Python-Dev] Noam's open regex requests

Raymond Hettinger python at rcn.com
Sun Sep 19 00:34:08 CEST 2004


[Noam Raphael]
> I've suggested three things that I think should be done in that
> case, and nobody objected.
>
> 1. Add a prominent note in the module contents page or in the module's
> main page, stating that some functionality can only be acheived by
using
> compiled REs.

I would make that read "The methods of compiled regular expressions
allow more options than their simplified function counterparts.  Most
non-trivial applications always use the compiled form."



> 2. Document the optional parameters which let you specify the start
and
> end pos in the findall and finditer methods of a compiled RE object.

This seems reasonable to me.  The API is already exposed and is useful.
Why not document it.  AFAICT, there are no plans to take away the
functionality.



> 3. Add the optional parameter "flags" to the findall and finditer
> functions. Then, the four functions match, search, findall and
finditer
> would have the same interface: function(pattern, string[, flags]).

This also seems reasonable to me.  It is marginally useful and it may
reduce the learning curve ever so slightly.  There is nothing special
about findall() and finditer() that makes them different from match()
and search() with respect to flags.



Raymond Hettinger



More information about the Python-Dev mailing list