title: Regex fails in javascript
body: <p>I have a following regex expression in javascript</p>
  
  <pre><code>var reg = new RegExp("^[(]?[2-9]\d{2}[)]?[\-. :]?[2-9]\d{2}[\-. :]?\d{4}$");
  return this.optional(element) || (reg.test(value));
  </code></pre>
  
  <p>in my code reg.test(value) return false even on correct values: for instance 222 222 2222 or 222-222-2222. All regex testers(especially <a href="http://tools.netshiftmedia.com/regexlibrary/" rel="nofollow">this</a> one, which calls the same methods) show that regex matches the expression. What can be the problem?</p>