FWIW, here is the Java code we use to validate email addresses. The Regexp's are very similar:
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
public static boolean validate(String emailStr) {
Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(emailStr);
return matcher.matches();
}
Works fairly reliably.
Answer from Jason Buberel on Stack OverflowBaeldung
baeldung.com › home › java › email validation in java
Email Validation in Java | Baeldung
August 20, 2024 - The RFC 5322, which is an updated version of RFC 822, provides a regular expression for email validation. ... As we can see, it’s a very simple regex that allows all the characters in the email.
Top answer 1 of 16
330
FWIW, here is the Java code we use to validate email addresses. The Regexp's are very similar:
public static final Pattern VALID_EMAIL_ADDRESS_REGEX =
Pattern.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE);
public static boolean validate(String emailStr) {
Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(emailStr);
return matcher.matches();
}
Works fairly reliably.
2 of 16
185
Here is RFC822 compliant regex adapted for Java:
Pattern ptr = Pattern.compile("(?:(?:\\r\\n)?[ \\t])*(?:(?:(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[ \\t]))*\"(?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[ \\t]))*\"(?:(?:\\r\\n)?[ \\t])*))*@(?:(?:\\r\\n)?[ \\t])*(?:[^()<>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:\\r\\n)?[ \\t]))*\"(?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\"(?:[^\\\"\\r\\\\]|\\\\.|(?:(?:\\r\\n)?[ \\t]))*\"(?:(?:\\r\\n)?[ \\t])*))*@(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[ \\t])*)(?:\\.(?:(?:\\r\\n)?[ \\t])*(?:[^()<>@,;:\\\\\".\\[\\] \\000-\\031]+(?:(?:(?:\\r\\n)?[ \\t])+|\\Z|(?=[\\[\"()<>@,;:\\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\\n)?[ \\t])*))*\\>(?:(?:\\r\\n)?[ \\t])*))*)?;\\s*)");
String[] emails = { "\"Fred Bloggs\"@example.com", "[email protected]", "Chuck Norris <[email protected]>", "webmaster@müller.de", "[email protected]" };
for (String email : emails) {
System.out.println(email + " is " + (ptr.matcher(email).matches() ? "valid" : "invalid"));
}
Output:
"Fred Bloggs"@example.com is valid
[email protected] is invalid
Chuck Norris <[email protected]> is valid
webmaster@müller.de is valid
[email protected] is valid
The regex is taken from this post: Mail::RFC822::Address: regexp-based address validation. The results should coincide with online version.
Regular Expression standard for email address validation
Not programming horror because, IIRC email addresses aren't regular, and therefore any good regex is going to be a mess. After looking it up, that RFC seems to have some programming horror as the regex allows for "00" as an octet in an IP address used in the domain portion of the email address. More on reddit.com
Java email validation
Hi, I need to write an email validation script. It needs to take the email typed in from the user and verify is certain criteria are met and give a… More on reddit.com
Regex Email Validation
Hi friends! Glad to be using Text Blaze in my job again, I used it a ton at my old job! Trying to make the absolute best use of it now that I am at a tech company! My use case here relates to populating user name and email addresses from a Zendesk ticket to my notes via regex. More on community.blaze.today
v2.0.0 of JMail, the popular email address validation library, is now available
I very much like the correctness comparison table with other libraries over at https://www.rohannagar.com/jmail/ Very nice work! More on reddit.com
Videos
Accurate Email Validation in Java Using Regex
04:41
Validate Email Address In Java Using Regular Expression. - YouTube
05:04
How to Write a Regex to Validate Emails | Java Regex Tutorial | ...
06:31
Simple Email Validation in Java - Tutorial by Mailtrap - YouTube
00:15
#shorts email validation using regex in #java | dcoder app - YouTube
Simple Email Validation in Java - Tutorial by Mailtrap
Mailtrap
mailtrap.io › blog › java-email-validation
Java Email Validation + Email Regex for Java | Mailtrap Blog
February 14, 2025 - Email alice@example.com is valid Email alice#bob@example.com is valid Email alice`bob@example.com is valid Email @example.com is invalid Email alice@example.com. is invalid Email alice@example..com is invalid · Finally, let’s improve the previous regex versions to ensure that the domain name part contains at least a single dot. Also, let’s add a condition that verifies that the section of the domain name after the final dot only comprises of letters. Furthermore, we’ll ensure that the top-level domain (such as .com) comprises of at least two to six letters. ... import java.util.ArrayLis
TutorialsPoint
tutorialspoint.com › checking-for-valid-email-address-using-regular-expressions-in-java
How to validate an email address format in Java
public class Main { public static void main(String[] args) { String EMAIL_REGEX = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; String email1 = "user@domain.com"; Boolean b = email1.matches(EMAIL_REGEX); System.out.println("is e-mail: "+email1+" :Valid = " + b); String email2 = "user^domain.co.in"; b = email2.matches(EMAIL_REGEX); System.out.println("is e-mail: "+email2+" :Valid = " + b); } } The above code sample will produce the following result. is e-mail: user@domain.com :Valid = true is e-mail: user^domain.co.in :Valid = false · The following is an example to validate an email ad
Medium
medium.com › @python-javascript-php-html-css › validating-email-addresses-in-java-with-regex-69f7b3846aa2
Java Email Address Validation Using Regex
August 24, 2024 - One common issue encountered is the acceptance of special characters at the beginning of an email address, which is not typically allowed according to standard email format specifications. The regex pattern provided aims to address this by filtering out email addresses that do not meet the criteria, yet it inadvertently allows certain special characters at the start.
Reddit
reddit.com › r/learnprogramming › java email validation
r/learnprogramming on Reddit: Java email validation
February 18, 2022 - There's a surprising number of unexpected things that are legal in an email address and an even bigger number of even more surprising things that aren't. This blogpost describes how to build an email parser ... That looks interesting. Thanks. Will have a look Sunday, need to prep for the midterm on Saturday (sigh). ... Need help with learning Java.
UI Bakery
uibakery.io › regex-library › email-regex-java
Email regex Java
import java.util.regex.Pattern; import java.util.regex.MatchResult; public class Main { public static void main(String []args) { // Validate if a string is a email boolean isMatch = Pattern.compile("^\\S+@\\S+\\.\\S+$") .matcher("hello@uibakery.io") .find(); // returns true // Extract emails from a string String[] matches = Pattern.compile("\\S+@\\S+\\.\\S+") .matcher("You can reach me out at hello@uibakery.io and contact@uibakery.io") .results() .map(MatchResult::group) .toArray(String[]::new); // returns ["hello@uibakery.io", "contact@uibakery.io"] } }
Coderanch
coderanch.com › t › 489309 › java › java-regex-email-validation
java regex email validation (Java in General forum at Coderanch)
March 29, 2010 - I'd do with the org.apache.commons.validator.EmailValidator class.
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Regular_expressions
Regular expressions - JavaScript | MDN
March 17, 2026 - When you want to know whether a pattern is found in a string, use the test() or search() methods; for more information (but slower execution) use the exec() or match() methods. If you use exec() or match() and if the match succeeds, these methods return an array and update properties of the associated regular expression object and also of the predefined regular expression object, RegExp.
Coderanch
coderanch.com › t › 376533 › java › Jakarta-RegExp-Email-Validation
Jakarta RegExp - Email Validation (Java in General forum at Coderanch)
April 18, 2005 - This is what I have: RE emailPattern = new RE("((^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9])|([^\"*$\"]))@[a-z-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$"); Thanks. SK ... less than a month ago, we had a small discussion here: https://coderanch.com/t/376344/java/java/Regex-email-verifying - not discussing the RFC - using javas regexes - I don't know where they differ from jakartas.
OCPsoft
ocpsoft.org › home › tutorials › regular expressions › email regular expression
Email Regexp | Validate Email Java | Regular Expression for Email | OCPsoft
September 19, 2012 - A brief tutorial / tip for how to validate email addresses with regular expressions. Also includes examples of how to validate with native languages.
Emailregex
emailregex.com › index.html
Email Address Regular Expression That 99.99% Works.
November 15, 2019 - Start by entering a regular expression and then a test string. Please refer to the Regex Cheat Sheet on the left hand side. ... Another way is to use the System.Net.Mail.MailAddress class. To determine whether an email address is valid, pass the email address to the MailAddress.MailAddress(String) class constructor.
Mkyong
mkyong.com › home › regular expressions › java email regex examples
Java email regex examples - Mkyong.com
November 2, 2020 - It checks to ensure the email contains at least one character, an @ symbol, then a non whitespace character. ... ^ #start of the line ( # start of group #1 .+ # any characters (matches Unicode), must contains one or more (+) ) # end of group #1 @ # must contains a "@" symbol ( # start of group #2 \S+ # non white space characters, must contains one or more (+) ) # end of group #2 $ #end of the line · 1.1 A Java example using the above regex for email validation.
Stack Abuse
stackabuse.com › java-regular-expressions-how-to-validate-emails
Java Regular Expressions - How to Validate Emails
May 12, 2023 - Email '[email protected]' is valid! Awesome! This general-purpose RegEx will take care of pretty much all generic input and will check whether an email follows the generic form that all emails follow.
Xperti
xperti.io › home › what is the best java email address validation method?
Java Email Validation Using Regular Expressions
January 11, 2024 - It’s a great source for authenticating a user. Email addresses are required for registration. Java offers a variety of methods to validate the entered email address. In this article, we will be discussing some methods for validating an email address in Java using regular expressions (Regex).
JustAnswer
justanswer.com › computer-programming › kyvha-email-validation-question-using-regex.html
Expert Q&A: Email Validation Using Regex in Java and HTML
My question is, why does this RegEx only accept lowercase domain names, and how can I modify it to accept uppercase domains as well? ... Nice to meet you. My name is Wosen. ... Hello, it's a pleasure to meet you. ... The first part is functioning correctly, as it accepts both lower and upper case. However, the domain is currently only accepting lower case. ... The email list should only accept this domain.