re vs. sgmllib (was: Moving from Perl to Python)
Brian Rogoff
bpr at shell5.ba.best.com
Wed Sep 29 00:15:29 EDT 1999
On Sun, 26 Sep 1999, Tim Peters wrote:
> [Jon Fernquest]
> > Since regular expressions are just a short-hand way of specifying
> > (practically only *some*) regular languages whereas finite state
> > machines can specify any regular language the next logical step
> > would be a set of finite state tools like those that Xerox sells
> > (for several thousands of dollars I might add).
>
> Then I hope we can skip the next logical step and leapfrog illogically to a
> real parser <wink>. Part of the problem here is that what people want to
> parse these days-- from programming language fragments to SGML --isn't
> regular. That doesn't stop them from trying to do it with regexps, and
> input-sensitive bug-ridden code is the result. Heck, most people find it a
> challenge to write a correct regexp to match a Python string -- or even a C
> /**/ comment. Not that regular languages aren't useful, but I expect their
> appropriate non-trivial applications will always be a wizard art.
It might be interesting to add SNOBOL4 style patterns to Python then.
There was some work by SNOBOL's creators to add SNOBOL patterns to a
language with more conventional syntax (REBUS was the name I think) but it
got dropped when all of the effort shifted to Icon.
-- Brian
More information about the Python-list
mailing list