[relaxng-user] regular expressions

David Tolpin dvd at davidashen.net
Fri Jan 30 20:58:20 ICT 2004


Hi,

I have built and put on the server for download RNV for Win32 (built with cygwin
tools). rnv there has pluggable datatypes support turned on and allows to specify 
regular expressions split in named parts.

 http://www2.davidashen.net/rnv-1.5.5-cygwin32bin.zip

Readme is cygwin\readme-rnv.txt

Sample is 
  cd cygwin\usr\local\lib\rnv\samples
  rnv -e ../scm/dsl.scm addr-spec-dsl.rnc addr-spec.xml

And the regexp looks like: 

    s-pattern="""
      comment = "\(([^\(\)\\]|\\.)*\)"
      atom = "[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+"
      atoms = atom "(\." atom ")*"
      person = "\"([^\"\\]|\\.)*\""
      location = "\[([^\[\]\\]|\\.)*\]"
      local-part = "(" atom "|" person ")"
      domain = "(" atoms "|" location ")"
      start = "(" comment " )?" local-part "@" domain "( " comment ")?"
    """

It helps me debug long regular expressions; hopefully, it will also be useful
to others.

David Tolpin
http://davidashen.net/


More information about the relaxng-user mailing list