title: Don't understand the regular expression for valid XML charset
body: <p>As w3c describe the valid chars for XML is limited.</p>
  
  <p>We can recognize invalid char by following regular expression:</p>
  
  <pre><code>/*
   * From xml spec valid chars:
   * #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
   * any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
   */
      Pattern pattern = Pattern.compile("[^\\x09\\x0A\\x0D\\x20-\\xD7EF\\xE000-\\xFFFD\\x10000-x10FFFF]");
  </code></pre>
  
  <p>But I dont know why the expression isn't :</p>
  
  <pre><code> Pattern pattern = Pattern.compile("[^\\x09\\x0A\\x0D\\x20-\\xD7EF\\xE000-\\xFFFD\\x10000-\\x10FFFF]");
  </code></pre>
  
  <p>The error message is :</p>
  
  <pre><code>java.util.regex.PatternSyntaxException: Illegal character range near index 49
  [^\x09\x0A\x0D\x20-\xD7EF\xE000-\xFFFD\x10000-\x10FFFF]
  </code></pre>