[relaxng-user] rfc2822 compliant email pattern?

David Tolpin dvd at davidashen.net
Fri Jan 16 23:51:58 ICT 2004


> Dave,
> 
> if you need a regular expression for addr-spec, then it is
> 

Forgot to include quoted-pairs. This one should be better:

start=element addr-spec { 
  xsd:token {
  pattern="""([a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+(\.[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+)*|"([^"\\]|\\.)*")@([a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+(\.[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+)*|\[([^\[\]\\]|\\.)*\])"""
  }
}

David Tolpin


More information about the relaxng-user mailing list