[relaxng-user] Latest proposal for smart regexes in RELAX NG
David Tolpin
dvd at davidashen.net
Fri May 7 01:45:09 ICT 2004
>
> Nor was his production intended to be "a joke" or an example of
> illegibility. He very carefully builds up to it, so that folks can be
> impressed at the fact that they can read it, using the techniques he's
> presented.
It was simply ill-designed; the author attempted to normalize whitespace
and linefeeds in the same expression which parses the actual syntax.
This is wrong. Noone uses regexps in this way.
The first step is to replace multiple spaces and carriage returns
with single non repeating space characters. Anyone who knows
how to use regular expressions and tools based on them can do it.
The second step is to parse the syntax with normalized space, which
is a much smaller regular expression.
The author of that regular expression had just messed things up.
This is not how things are done.
> That doesn't make it any less rococo. Regexes are wonderful, as John
> Cowan points out, for small applications, but the inability to break them
> into pieces and then put the pieces together, a facility that he's built
This has no relation to John Cowan's proposal. I too agree that ability
to break them into pieces and then built from pieces complex ones
is useful. How does this relate to using XML syntax for regular expressions?
> The perl whitespace extensions alone are worth the price of entry for perl
> regexes. Using them, any expression can be reformatted into (nearly)
> digestible chunks and analyzed so.
Wrong.
More information about the relaxng-user
mailing list