Re: ANN: RNV 1.5.2
David Tolpin <[email protected]>
| Newsgroups | gmane.text.xml.relaxng.general |
|---|---|
| Message-ID | <[email protected]> |
> http://davidashen.net/rnv.html
>
> Two ways to use extension datatype libraries are implemented for RNV;
Forgot to mention: a Scheme implementation of XML Schema regular expressions
is a part of the distribution; it makes possible to conveniently debug
regular expressions by writing:
(define addr-spec-regex
(let* (
(atom "[a-zA-Z0-9!#$%&'*+\\-/=?\\^_`{|}~]+")
(person "\"([^"\\\\]|\\\\.)\"")
(location "\\[([^\\[\\]\\\\]|\\\\.)*\\]")
(domain (string-append atom "(\\." atom ")*")))
(string-append
"(" domain "|" person ")"
"@"
"(" domain "|" location ")")))
...
(rx-match (rx-compile addr-spec-regex) s)
instead of:
pattern=
"(\(([^\(\)\\]|\\.)*\) )?"
~ "([a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+"
~ "(\.[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+)*"
~ """|"([^"\\]|\\.)*")"""
~ "@"
~ "([a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+"
~ "(\.[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+)*"
~ "|\[([^\[\]\\]|\\.)*\])"
~ "( \(([^\(\)\\]|\\.)*\))?"
David Tolpin