title: Rails regex email validation with no spaces allowed
body: <p>I am currently using this code for my email validation: </p>
  
  <pre><code>/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
  </code></pre>
  
  <p>the problem is it still accepts emails with spaces like <code>ab c@gmail.com</code>. </p>
  
  <p>I've tried a lot of variations of the code that should not allow spaces, but instead of refreshing the page with an error message at the top of the form, it gives me this error:</p>
  
  <blockquote>
    <p>The provided regular expression is using multiline anchors (^ or $),
    which may present a security risk. Did you mean to use \A and \z, or
    forgot to add the :multiline => true option?</p>
  </blockquote>