title: How to translate ruby regex to javascript? - (?i-mx:..) and Rails 3.0.3
body: <p>Im using validates_format_of method to check email format:</p>
  
  <pre><code>validates_format_of :email, :with =&gt; /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
  </code></pre>
  
  <p>also Im using livevalidation plugin to validate forms, so in my code Im getting:</p>
  
  <pre><code>(?i-mx:^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$)
  </code></pre>
  
  <p>Javascript cant read this regex. How or where I can change this regex to be as original: </p>
  
  <pre><code>/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
  </code></pre>
  
  <p>?</p>