Psypher
Psypher

Reputation: 10839

Supported characters in xsd pattern

I have the following in the xsd, the pattern says it should be "\d{10}", does this mean:

Following is the xml:

  <xs:simpleType name="zip">
        <xs:restriction base="xs:string">
            <xs:pattern value="\d{10}"/>
        </xs:restriction>
    </xs:simpleType>

Upvotes: 1

Views: 434

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167571

In the schema language and its regular expressions, \d stands for Unicode decimal digits, that includes the ASCII digits 0, 1, ..., 9, but also a lot of other digits of other scripts, see http://www.fileformat.info/info/unicode/category/Nd/list.htm. If you only want to allow ASCII digits then use [0-9]{10}.

Upvotes: 2

Related Questions