1

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

  • it supports only 10 characters(i.e digits, alphabets, special character)
  • it supports only 10 digits(i.e only 0 to 9)

Following is the xml:

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

1 Answer 1

2

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

1
  • K..so it means always digits..but supports other unicode..great..!! There were lot of answers but they were not very clear about it
    – Psypher
    Feb 11, 2016 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.