Python regular expressions just ain't PCRE

John Machin sjmachin at lexicon.net
Tue May 8 18:03:25 EDT 2007


On May 9, 7:34 am, Klaas <mike.kl... at gmail.com> wrote:
> On May 5, 6:57 pm, Wiseman <Wiseman1... at gmail.com> wrote:
>
> > > There's also the YAGNI factor; most folk would restrict using regular
> > > expressions to simple grep-like functionality and data validation --
> > > e.g. re.match("[A-Z][A-Z]?[0-9]{6}[0-9A]$", idno). The few who want to
> > > recognise yet another little language tend to reach for parsers, using
> > > regular expressions only in the lexing phase.
>
> > Well, I find these features very useful. I've used a complex, LALR
> > parser to parse complex grammars, but I've solved many problems with
> > just the PCRE lib. Either way seeing nobody's interested on these
> > features, I'll see if I can expose PCRE to Python myself; it sounds
> > like the fairest solution because it doesn't even deal with the re
> > module - you can do whatever you want with it (though I'd rather have
> > it stay as it is or enhance it), and I'll still have PCRE. That's if I
> > find the time to do it though, even having no life.
>
> A polished wrapper for PCRE would be a great contribution to the
> python community.  If it becomes popular, then the argument for
> replacing the existing re engine becomes much stronger.
>
> -Mike

You seem to be overlooking my point that PCRE's unicode support isn't,
just like the Holy Roman Empire wasn't.





More information about the Python-list mailing list