title: Typescript how to escape backslash character
body: <p>I would like to create a regular expression in Typescript to match the decimal separator character followed by a sequence of <code>0</code>s in a string.  For example, if the decimal separator is <code>.</code>, then the expression I've come up with is:</p>
  
  <pre><code>/\.0+\b/g
  </code></pre>
  
  <p>Since the decimal separator is determined at run-time based on locale, I am constructing my expression in code, with the <code>decimalSeperator</code> as a variable:</p>
  
  <pre><code> "/\\" + decimalSeperator + "0+\b/"; 
  </code></pre>
  
  <p>My intention is that the double backslash characters will be escaped to a single backslash character.</p>
  
  <p>However, the double backslash characters are not being escaped in my compiled JavaScript:</p>
  
  <pre><code>"/\\" + decimalSeperator + "0+\b/"
  </code></pre>
  
  <p>Yet if I used a single backslash, the code won't compile due to the <code>"</code> being escaped:</p>
  
  <pre><code>"/\" + decimalSeperator + "0+\b/"; 
  </code></pre>
  
  <blockquote>
    <ul>
    <li>error TS1005: ',' expected. </li>
    <li>error TS1127: Invalid character.</li>
    <li>error TS1002: Unterminated string literal.</li>
    </ul>
  </blockquote>
  
  <p>Is this a bug with Typescript or am I doing something wrong?</p>
  
  <p>Thanks</p>