A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/047536.html below:

Complete, Structured Regular Expression Group Matching

[Python-Dev] Re: pre-PEP [corrected]: Complete, Structured Regular Expression Group MatchingErik Heneryd erik at heneryd.com
Tue Aug 10 15:00:50 CEST 2004
Fredrik Lundh wrote:
> a regular expression defines a set of strings, and the RE engine is designed to
> tell you if a string you have is a member of this set.  the engine's not a parser,

Well, as you know (and point out now and then), regexes aren't regular 
expressions in the CS sense.  And most people don't use em just to see 
if a string matches or not, but to see what parts matches waht.


> you're probably better off using the scanner mechanism:
> 
>     http://effbot.org/zone/xml-scanner.htm
> 
> or the sre.Scanner class (see the source code).  the scanner concept could
> need some documentation, and it would be nice to be able to switch patterns
> during parsing.  (time for a scanner PEP, anyone?)

I'd love to see scanners as an official part of the stdlib.  Isn't this 
just a matter of documentation?


Erik

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4