title: Range out of order in character class - regex
body: <p>I have the following set of code</p>
  
  <pre><code>var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF
  var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\u00B7\u0300-\u036F\\ux203F-\u2040]");
  var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
  </code></pre>
  
  <p>It throws the following error:</p>
  
  <pre><code>sqmtest I/JS: SyntaxError: Invalid regular expression: /[\-\.0-9A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD????-??\ux203F-???]/: Range out of order in character class
  at new RegExp (&lt;anonymous&gt;)
  at RegExp (&lt;anonymous&gt;)
  at Object.$$_sax (http://com.hashcube.sqtest/modules/devkit-core/src/clientapi/native/dom/sax.js:1:5952)
  at I (none:615:5092)
  at z (none:615:6690)
  at Object.jsio (none:615:7357)
  at Object.$$_dom_parser (http://com.hashcube.sqtest/modules/devkit-core/src/clientapi/native/dom/dom_parser.js:1:3511)
  at I (none:615:5092)
  at z (none:615:6690)
  at Object.jsio (none:615:7357)
  at Object.$$_dom_DOMParser (http://com.hashcube.sqtest/modules/devkit-core/src/clientapi/native/dom/DOMParser.js:1:66)
  at I (none:615:5092)
  at z (none:615:6690)
  at Object.jsio (none:615:7357)
  at Object.$$_common.exports.install (http://com.hashcube.sqtest/modules/devkit-core/src/clientapi
  </code></pre>
  
  <p>The full code is here -> <a href="https://github.com/hashcube/devkit-core/blob/hc/src/clientapi/native/dom/sax.js" rel="nofollow noreferrer">https://github.com/hashcube/devkit-core/blob/hc/src/clientapi/native/dom/sax.js</a></p>
  
  <p>Any idea why the regex could be failing.
  I have not confirmed this, but looks like minification could be causing an issue.</p>
  
  <p>Any thoughts suggestions would help me. I can provide more details if needed</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have more information. I looked at the minifed code for both these lines from 2 machines(1 machine where I get this error and another where I don't get the error). It looks like an encoding issue to me. Any help would be appreciated</p>
  
  <p>Machine with Error</p>
  
  <pre><code>var nameStartChar=/[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/,
    nameChar=RegExp("[\\\\-\\\\.0-9"+nameStartChar.source.slice(1,-1)+"????-??\\\\ux203F-???]"),
    tagNamePattern=RegExp("^"+nameStartChar.source+nameChar.source+"*(?::"+nameStartChar.source+nameChar.source+"*)?$"),S_TAG=0,S_ATTR=1,S_ATTR_S=2,S_EQ=3,S_V=4,S_E=5,S_S=6,S_C=7;
  </code></pre>
  
  <p>Machine without error</p>
  
  <pre><code>var nameStartChar=/[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/,
    nameChar=RegExp("[\\\\-\\\\.0-9"+nameStartChar.source.slice(1,-1)+"·�~@-ͯ\\\\ux203F-�~A~@]"),]"),A~@
    tagNamePattern=RegExp("^0-9"+nameStartChar.sou+nameChar.source+"*(?::"+nameStartChar.source+nameChar.source+"*)?$"),S_TAG=0,S_ATTR=1,S_ATTR_S=2,S_EEouQ=3,S_V=4,S_E=5,S_S=6,S_C=7;
  </code></pre>