title: JavaScript minification fails containing certain Regex
body: <p>I can't minify a javascript file containing this working <code>Regex</code>:</p>
  
  <pre><code>isValid = function (str) {
      return !/[~`!#$%\^&amp;*+=\-\[\]\\';,/{}|\\":&lt;&gt;\?]/g.test(str);
  },
  </code></pre>
  
  <p>Error message:</p>
  
  <pre><code>/* Minification failed. Returning unminified contents.
  (2128,43-44): run-time error JS1004: Expected ';': {
  (2128,45-46): run-time error JS1195: Expected expression: |
  (2128,46-47): run-time error JS1014: Invalid character: \
  (2128,47-48): run-time error JS1014: Invalid character: \
  (2128,48-70): run-time error JS1015: Unterminated string constant: 
                                       ":&lt;&gt;\?]/g.test(str);
  (2129,6-7)  : run-time error JS1195: Expected expression: ,
  (2128,17-43): run-time error JS5017: Syntax error in regular expression: 
                                       /[~`!#$%\^&amp;*+=\-\[\]\\';,/ 
  */
  </code></pre>
  
  <p>Bundle Config:</p>
  
  <pre><code>bundles.Add(new ScriptBundle("~/bundlesJs/custom").Include(
      "~/Scripts/Autogenerated/AntiHacking/antiHackingHelper.js"
  ));
  BundleTable.EnableOptimizations = true;
  </code></pre>
  
  <p>How can this be solved? Is there a character that needs to be escaped or should I wrap the whole Regex?</p>