68 399
Assignments Done
98,5%
Successfully Done
In December 2018

Answer to Question #26194 in Other Programming & Computer Science for Mahendra

Question #26194
i need a help for getting free script for valdiate any email address is valid or not
for e.g suppose i enter xxxx@yahoo.com than i want to know whether this email is availabel or not in yahoo and i want to check any domain's email address
Expert's answer
You should use regular expressions. Example:
public class test
{

publicstatic void main(String[] args) {
System.out.println(isValidEmail("xxxx@yahoo.com"));
}

publicstatic boolean isValidEmail(String email) {
Patternp = Pattern
.compile("^[A-Za-z0-9.%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,4}");
Matcherm = p.matcher(email);
returnm.matches();
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions