title: Email validation regular expression in cshtml using jquery pops error
body: <p>While validating email textbox using regex and jquery in shtml page, error pops showing issue with regex as it contains "@" in the regex.</p>
  
  <pre><code>$(document).ready(function() {
  
  $('#btn-submit').click(function() { 
  
      $(".error").hide();
      var hasError = false;
      var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;   //"@" in regex is the issue
  
      var emailaddressVal = $("#UserEmail").val();
      if(emailaddressVal == '') {
          $("#UserEmail").after('&lt;span class="error"&gt;Enter email address.&lt;/span&gt;');
          hasError = true;
      }
  
      else if(!emailReg.test(emailaddressVal)) {
          $("#UserEmail").after('&lt;span class="error"&gt;Enter a valid email address.&lt;/span&gt;');
          hasError = true;
      }
  
      if(hasError == true) { return false; }
  
     });
  });
  </code></pre>