Re: rfc2822 compliant email pattern?

David Tolpin <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
> <grin/> Don't tell me, you just worked it out?

In fact, I did. It's not awful -- just looks so. If there were
defines for parts, it would be a lot easier to write. 

atext=[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+ # taken from the RFC
quoted-string="([^"\\]|\\.)*" # that is, not-quote inside quotes, or an escape
domain-content=\[([^\[\]\\]|\\.)*\] # that is, anything in square brackets, brackets are escaped if inside the brackets

local-part = atext(\.atext)*|quoted-string
domain-part = atext(\.atext)*|domain-content

addr-spec = local-part @ domain-part



David
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.