I need to check if a string (local part of email address) has nothing except:
- letters (a-zA-Z)
- numbers (0-9)
- underscores
- at most one dot (.)
How do I do it using Java regex
?
Example: a_1_b.c
and a_b_1
, should be okay ,but 1.a_b.2
and 1_a*3
should be discarded.