recording data between [ and ]
rbt
rbt at athop1.ath.vt.edu
Thu Apr 21 11:25:23 EDT 2005
Roy Smith wrote:
> Diez B. Roggisch <deetsNOSPAM at web.de> wrote:
>
>>>Yes, it does... may take me a few minutes to get my head around it
>>>though. Why do re's have to be so arcane and complicated... especially
>>>in Python?
>>>
>>>It's hard to preach 'ease of use' with stuff such as this in the
>>>language. Perhaps one day it can be rolled up into something that
>>>*really* is easy to understand:
>>
>>Welcome to the wonderful world of programming. Regular expressions are what
>>they are because they are modeled after a certain theory - that of finite
>>state automata and their correspondence to certain classes of
>>grammars.
>
>
> Another way to look at it is that RE's are a programming language of
> their own, and Python just provides an interface to it, just like it
> provides interfaces to databases, network protocols, and operating
> systems.
>
> RE's predate Python by many years (at least as far back as the early
> 70's in a form we would recognize today), and have evolved over the
> decades to become more powerful. Unfortunately, with power came
> arcane syntax. On the good side, most of the time you can use a
> smallish subset of the full RE syntax and still have some pretty
> powerfull pattern matching.
>
> Python's motto is "there's one way to do it". Sometimes that means
> "let's do it the way everybody else does it instead of reinventing it
> ourselves". The Python RE module is certainly an example of that.
>
> BTW, there's a pretty good Wikipedia article on RE's
> (http://en.wikipedia.org/wiki/Regular_expression).
Thanks guys... nothing against Python... just RE's in general.
More information about the Python-list
mailing list