Regular Expressions - Python vs Perl
Ilpo Nyyssönen
iny+news at iki.fi
Fri Apr 22 00:32:03 EDT 2005
James Stroud <jstroud at mbi.ucla.edu> writes:
> Is it relevant that Python can produce compiled expressions? I don't think
> that there is such a thing with Perl.
The problem in python here is that it needs to always recompile the
regexp. I would like to have a way to write a regexp as a constant and
then python should compile that regexp to the byte-code file.
This is a problem when one has a big amount of regexps. One example is
the xmlproc parser in PyXML,
This is not a problem in a program that continues to run long times,
but I want short lived programs like command line apps.
Of course we do have ways to go around that limitation, but that is
just ugly.
--
Ilpo Nyyssönen # biny # /* :-) */
More information about the Python-list
mailing list