You can never go down the drain...

cLIeNUX user r at
Thu Sep 28 04:26:08 CEST 2000

kragen at 
>In article <wCgA5.844$d5.51939 at>,
>Fredrik Lundh <effbot at> wrote:
>>> > imho, regular expressions suck.
>>. . . nobody can convince me that line noise is the best way to
>>talk to a string matching engine -- as soon as you go beyond the
>>regular basics (literals, dot, star, ranges), there are better ways
>>to express yourself.
>Olin Shivers concocted something called SRE --- see
>REBOL also has a human-readable BNF syntax: 
>And the "Text Machine" someone else pointed to also looks pretty cool:
>The Perl RE syntax (especially with Python extensions like named match
>bits) is a significant advancement over standard Unix-style REs, which
>in turn were a huge advancement over their contemporary TECO-style REs,
>which used control characters for metacharacters.
>I'm sure that the FORTH guys have given some thought to building a
>regular-expression engine in FORTH words, but the only thing I can find
>is this 1988 BNF parser:
>(FORTH is harder to search for on Google than, say, REBOL or Python.
>Lots of web pages contain the word 'forth' without being about FORTH.
>Useful extra search terms are 'fig', 'sigforth', 'words', 'vocabulary',
>'screen', 'stack', 'colon', 'colon-definition',)

There's a Forth REGEX package on taygeta somewhere with permutation and
combination regexes. I don't think the ed family regexes are all that bad,
though, given that specifying wierd string matching patterns is just plain
awkward inately. The problem is usually the unexpectedly extreme
specificity of what you actually want, not the grammar of expressing it.

The problems I DO have with ed regexes are largely fixed in the Bell Labs
sam editor. A regex can contain a \n . Hallelueah. Sam is the one ed
update that fully appreciates the original. sam maintains the internal 
image of the text file as an RDBMS. The author of sam then led the Plan9

Rick Hohensee

><kragen at>       Kragen Sitaker     <>
>Perilous to all of us are the devices of an art deeper than we ourselves
>                -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]

More information about the Python-list mailing list