title: Removing trailing characters after email address with Regex
body: <p>I am using regex to identify if a string is a valid email address or not. Pattern:</p>
  
  <pre><code>private static final String EMAIL_PATTERN = 
      "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
      + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
  </code></pre>
  
  <p>The problem is that this regex pattern cannot correctly identify the email address if it contains a trailing character. e.g: "test@example.com." or "test@example.com,"</p>
  
  <p>Do you know of a regex pattern that can take this into account?</p>