builtin regular expressions?

MonkeeSage MonkeeSage at gmail.com
Mon Oct 2 02:14:07 CEST 2006


Max M wrote:
> When I used to program in Perl I used regex' for lots of stuff. In
> python I probably use them once every half year. I sinply do not need them.

I think you can pretty much do it either way without any big benefits /
losses. There are edge-cases that will break a praser just like there
are ones that will break a regexp. In perl5 you can slice strings ( my
$s="Cat in a tree"; ${s:0:3} == 'Cat' ) and other things like that, but
I seldom see those used except for very trivial cases (i.e., the
seeming reverse of the python practice). But this hasn't caused some
kind of huge epidemic of non-working programs / libraries in the perl
world. If you understand how to use regexps and they are easier for
you, there is no reason not to use them. On the other hand, if they
make it harder for you, don't use them.

Regards,
Jordan




More information about the Python-list mailing list