Re: rfc2822 compliant email pattern?

David Tolpin <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
John,

let's not start it.

> (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
> )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
> \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
> ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ 

t is not XML Schema Datatypes Regular  Expressions, which is the only regex
syntax usable with Relax NG today (and tomorrow, I'm afraid).

Besides, a fair amount of this regular expression deals with white space.
Meanwhile, XML Schema Datatypes provides xsd:token datatype, which normalizes
whitespace. If the whitespace expressions were removed or reduced to ' ?', it
would become so much smaller.

I think that, for practical purposes, the expression for addr-spec, with spaces
inserted between parts, if required, is sufficient.

David Tolpin http://davidashen.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.