title: Javascript regex check freezes web page
body: <p>I am trying to do a regex test on an email address input. This works fine for smaller strings but when the input string gets too long, the regex text just freezes the thread/web page.</p>
  
  <p>The expression I am using is (Tried even the simplest ones with the same result):</p>
  
  <pre><code>^(([a-zA-Z0-9ÆØÅÄÖæøåäö]+)([\._\-\+]?[a-zA-Z0-9]+)*)@((\[[0-9]{1,3}\.[0-9]{1,3\.[0-9]    {1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$
  </code></pre>
  
  <p>The input is like this : </p>
  
  <pre><code>rjkfonsdjvcnkdcmklsdncjsdkcdsamcjbsdjcmsdcnsdjcvksadcnsdjbc
  </code></pre>
  
  <p>at the time of it breaking.</p>
  
  <p>The Javascript code I use to validate :</p>
  
  <pre><code>function (regex, val) {
      var rx = new RegExp(regex);
      return rx.test(val);
  }
  </code></pre>