[relaxng-user] Latest proposal for smart regexes in RELAX NG
jcowan at reutershealth.com
jcowan at reutershealth.com
Wed May 5 15:08:54 ICT 2004
David Tolpin scripsit:
> I am asking because I have a feeling that the string-based (as opposed
> to XML) syntax for regular expressions (unix-like, adopted by W3C Schema)
> is the compact syntax. It is easy to write and convenient to use,
> and actually needs just one addition: ability to compose a regular
> expression from parts.
It's neither easy to write nor convenient to use, it's just that we're all
so used to it. It optimizes the wrong things ("[A-Z]" rather than "[:ucalpha:]"),
it has many subtly incompatible flavors, it is unspeakably rococo, and it
does not scale. It is an attempt to avoid quoting literals, and it suffers from
the same problems that all such attempts suffer from.
I admit that to make my design really usable with the compact mode, it will
need an extension to the compact-mode translator: the bracket syntax is
not likely to cut it.
> I think that use of XML syntax for string templates (and regular expressions
> are string templates) is plain wrong.
No, they aren't string templates. They degenerate to string templates.
That's quite different.
> Strings are not trees.
Regular expressions *are* trees: they are compositions of sequence, choice,
and zeroOrOne. Everything else is just syntactic sugar. (Note that I
do not provide for backreferences, a la \1, \2, ..., which make the regular
expressions no longer regular.)
--
Go, and never darken my towels again! John Cowan
--Rufus T. Firefly www.ccil.org/~cowan
More information about the relaxng-user
mailing list