builtin regular expressions?

Mirco Wahab wahab at chemie.uni-halle.de
Sat Sep 30 10:44:13 EDT 2006


Thus spoke Antoine De Groote (on 2006-09-30 11:24):

> Can anybody tell me the reason(s) why regular expressions are not built 
> into Python like it is the case with Ruby and I believe Perl? Like for 
> example in the following Ruby code
> I'm sure there are good reasons, but I just don't see them.
> Python Culture says: 'Explicit is better than implicit'. May it be 
> related to this?

I think it is exactly because the /\b(\d+)\s+\/\//
together with $_ and $whatever=~/\/\/(?=\d+)/ are
seen as the 'line noise' everybody talks about ;-)

Regex as part of the core language expressions
makes code very very hard to understand for
newcomers, and because Python is ...

To invoke an additional cost in using Regexes,
the language simply prevents them in a lot of
situations. Thats it. You have to think three
times before you use them once. In the end,
you solve the problem 'elsewise' because of
the pain invoked ;-)

Regards

Mirco




More information about the Python-list mailing list