title: Remove Invalid characters in an e-mail address
body: <p>I'm trying to find out how to remove all invalid characters in an email address.</p>
  
  <p>Ex: email="taeo͝';st@yy.com"(. is an email character) and the result should be: email = "taest@yy.com"</p>
  
  <p>I'm using the following email pattern:</p>
  
  <pre><code>String email_pattern = "^[^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$]";
  
  String modifiedEmail = email.replaceAll(email_pattern,"");
  </code></pre>
  
  <p>But the above code is giving the result: email = "aest@yy.com" but expected "taest@yy.com"</p>
  
  <p>Any suggestions or a better approach would be appreciated.</p>