email valid in j2me lwuit
I am interested to know whether the email provided by user is validate or 开发者_Python百科not ? I try to use Pattern and Regex , but these classes are not available in lwuit j2me so how can I valid email in such case?
Check if there is exactly one @
symbol, and exactly one .
symbol, that .
is after the @
at least one letter or number in between, and the length of the trailing part after .
is between 2 and 3 letters. Some letters or numbers should be before @
.
The only way to validate an email address is to send an email and let the user tell you it arrived.
Email addresses can be very very complicated, so no easy check based on the address as a string will be correct in every case. As a sanity check, I'd check if it contains an @ sign, but nothing more.
精彩评论