[Python-Dev] Re: pre-PEP [corrected]: Complete, Structured Regular Expression Group Matching

Fredrik Lundh fredrik at pythonware.com
Mon Aug 23 13:41:26 CEST 2004


Mike Coleman wrote:

>> >>> parse("hello 1 2 3 4 # 5", "(\w+)", "\s*(\d+)")
>> ('hello', ['1', '2', '3', '4'], ' # 5')
>
> No offense, but this code makes me cringe.  The "|." trick seems like a
> horrific hack

"or any other character" a horrific hack?  that's RE 101, really.

and you're supposed to *use* the code, not stare at the implementation.
programming is all about abstractions, remember?

</F> 





More information about the Python-Dev mailing list