title: The value '<!\[CDATA\[.*?\]\]>|[^<>&]*' of the facet 'pattern' is not a valid regular expression
body: <p>I'm trying to use a regex to validate a field in my xml using xsd. I came up with the regex to do what I want which is to disallow special characters unless the text is wrapped in CDATA tags.  This is the regular expression I came up with:</p>
  
  <pre><code>&lt;!\[CDATA\[.*?\]\]&gt;|[^&lt;&gt;&amp;]*
  </code></pre>
  
  <p>Works great when I test it on <a href="http://regexr.com/" rel="nofollow">http://regexr.com/</a> to match my pattern.  The problem is when I try to then plug it into a simpleType pattern restriction I'm getting an error saying its not a valid regular expression.</p>
  
  <p><code>The value '&lt;!\[CDATA\[.*?\]\]&gt;|[^&lt;&gt;&amp;]*' of the facet 'pattern' is not a valid regular expression.</code></p>
  
  <p>Here is my xsd code (note I had to replace &amp;&lt;> in the regular expression with <code>&amp;lt;</code> <code>&amp;gt;</code> and <code>&amp;amp;</code> so it would be valid xml):</p>
  
  <pre><code>&lt;xs:element name="description" minOccurs="1" maxOccurs="1"&gt;
      &lt;xs:simpleType&gt;
          &lt;xs:restriction base="xs:string"&gt;
              &lt;xs:pattern value="&amp;lt;!\[CDATA\[.*?\]\]&amp;gt;|[^&amp;lt;&amp;gt;&amp;amp;]*"/&gt;          
          &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>So I assume there's something about the way regex works in xsd patterns that I'm not getting.</p>