title: UglifyJS Don't Mangle Specific Associative Array
body: <p>All our webservices are passed to our XHR via an associative array. IE:</p>
  
  <pre><code>new XHR({"year": 2015, "week": 6}, ...);
  </code></pre>
  
  <p>All our scripts are added to a single file, and this is then Uglified via (Essentially mangle and compress everything except for our entry point):</p>
  
  <pre><code>uglifyjs --mangle toplevel --screw-ie8 --compress --mangle-regex="/(?s)^((?!$$).)*$/" --reserve-domprops --reserved-file reserved -- input
  </code></pre>
  
  <p>The problem is, the <code>year</code> and <code>week</code> field keep getting obfuscated. So I tried putting a <code>$$</code> infront, so we now have <code>$$year</code> and <code>$$week</code>. To get this to work, I added the regex argument to the UglifyJS command above. I am trying to negate the lookup, so it will mangle all properties except those with a <code>$$</code> at the start (Can be any set of characters, just using <code>$$</code> as a starting point).</p>
  
  <p>My questions:</p>
  
  <ol>
  <li>Is this the best way to do it? Is there a way in UglifyJS to ignore certain associative arrays?</li>
  <li>Is my regex right? I've tried escaping the two dollar signs, I've tried with <code>__</code> instead of <code>$$</code> as well as several other attempts (Note: My regex is not good)</li>
  <li>If the regex is wrong, is there somewhere that would detail a method for creating a valid regex?</li>
  </ol>
  
  <p><strong>EDIT:</strong> Resolved. Needed to use this:</p>
  
  <pre><code>uglifyjs --mangle toplevel --screw-ie8 --mangle-props --mangle-regex="/^((?!\$\$).)*$/" --reserve-domprops --reserved-file reserved -- input &gt; output
  </code></pre>