Question:
JAVA HELP: How to check if an email address is in the correct format?
Mz. D
2012-10-28 23:47:35 UTC
I'm new to writing in Java and I've been given this problem in which I have an app with two JTextFields (Name & e-mail address) and a JButton. If the email address is in the incorrect format (john@@blank.com or john/#@blank.com) it has to display an error message, if the information is correct it displays what's written in a dialogue box and writes to a back-up file.

I've already written the code that displays what written in the textfield in the dialogue box, and writes to a file, but the email part is confusing. I've tried using a mask-formatter but that didn't work, and I need this figure this out by this Tuesday.

Can someone please help me! Any help is appreciated!
Three answers:
idan
2012-10-29 02:45:54 UTC
Take a look at http://en.wikipedia.org/wiki/Email_address#Syntax for a description of a valid email address + references to RFCs that describe the syntax in depth.
pessina
2016-12-12 20:13:39 UTC
in case you turn to Yahoo Mail Beta the %. are there as we communicate with the digital mail to view and save then you definately can change lower back to previous mail in case you pick. basically click the place it sez change lower back to classic yahoo mail decrease than WELCOME and your call..desire this helps.
Saiful A
2012-10-28 23:54:24 UTC
check this out



http://stackoverflow.com/questions/2762977/regular-expression-for-email-validation


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...