title: XSD Restriction based off of certain numbers in range using regular expression
body: <p>I am working on creating an XSD for a web service that will take in an ID number as an element in the XML. These ID numbers consist of 10 consecutive digits ([0-9]{10}), but I was trying to create a regular expression that could exclude certain elements from this range.   </p>
  
  <p>For example, here is the restriction I have currently in my XSD:  </p>
  
  <pre><code>    &lt;xsd:restriction base="xsd:string"&gt;
          &lt;xsd:pattern value="[0-9]{10}" /&gt;
      &lt;/xsd:restriction&gt;  
  </code></pre>
  
  <p>I need the restriction to allow a string of [0-9]{10} that doesn't fit the following IDs:</p>
  
  <pre><code>    All 0's:         [0]{10}
      Starting with 6: [6][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
      Starting with 000: [0][0][0][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
      Starting with 999: [9][9][9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
      Ends with 2 0's: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0][0]
      4 0's in Middle: [0-9][0-9][0-9][0][0][0][0][0-9][0-9][0-9]
  </code></pre>
  
  <p>Is this possible to do from within the XSD or regular expression?</p>
  
  <p>Thanks.  </p>