[relaxng-user] rfc2822 compliant email pattern?
David Tolpin
dvd at davidashen.net
Sat Jan 17 00:17:36 ICT 2004
> <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
More information about the relaxng-user
mailing list