i have a question :
I want to create an app that take a String from user input. This String will be in an email format. So there's some requirement's :
- .(full stop) can't be placed before @
- .(full stop) and @ can't be more than one
- .(full stop) and @ can't be side by side
Note : This is NOT a school homework(i just felt that this is like a homework after i typed it), i just want to learn more about String :D
I already did some research's but i still can't solve those problem's :D
Thanks all, and sory if i made some mistake's, English is not my native languange :D
This is Universal Email Validation For Email
ReplyDeleteif(eMailValidation(YourEmailString)){
/// right Email-id
}
public boolean eMailValidation(String emailstring) {
Pattern emailPattern = Pattern.compile(".+@.+\\.[a-z]+");
Matcher emailMatcher = emailPattern.matcher(emailstring);
return emailMatcher.matches();
}