a regular expression question

Roy Smith roy at panix.com
Sun Mar 23 08:30:47 EST 2003


Alex Martelli <aleax at aleax.it> wrote:
> Oh yes -- I find myself using RE's about 100 times less than I was
> using them back when I programmed in Perl, thanks on one side to the
> useful built-in methods of string objects, on the other to higher
> level library modules and extensions.

I suspect there's one other reason, and that's because RE's are easier 
to use in Perl than they are in Python.  The toolset drives how you use 
it.  I'm not saying that RE's are terribly difficult to deal with in 
Python, but one has to admit that the syntax is a bit clunkier and more 
verbose.  This is not surprising given that pattern matching was one of 
the prime design motiviation behind Perl.

Perl is a disaster as a general purpose programming language, but the 
one place it shines is the job it was designed for, and that's doing 
pattern matching on text.




More information about the Python-list mailing list