Here is the xsd code:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:e="
http://rep.oio.dk/email"
targetNamespace="
http://rep.oio.dk/email"
elementFormDefault="qualified" version="1.0">
<xsd:element name="email" type="e:emailType"/>
<xsd:simpleType name="emailType">
<xsd:restriction base="xsd:string">
<xsd:pattern
value="((\S*\s*)*<(([a-zA-Z0-9!#$%&'\*\+/=\?\^`\{\}\|~\._-])|(".+")|(\\.))+@([a-zA-Z0-9-])+(([a-zA-Z0-9-])*\.([a-zA-Z0-9-])+)+>)|((([a-zA-Z0-9!#$%&'\*\+/=\?\^`\{\}\|~\._-])|(".+")|(\\.))+@([a-zA-Z0-9-])+(([a-zA-Z0-9-])*\.([a-zA-Z0-9-])+)+)"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
------------------------------------------------------------------------------
This validates e-mail address like:
hello world <
Joe.\\Blow@example.com>
"Test Person" <$A12345@
example.com>
Abc\@def@
example.com
"Fred Bloggs"@
example.com
!def!xyz%abc@
example.com
Random <customer/department=
shipping@example.com>
------------------------------------------------------------------------------
Many thanks for any input,
Ben Azan