I am trying to validate a certain subset of the e-mail format with regular expressions, but what I've tried so far doesn't quite work. This is my regex (Java):
boolean x = l.matches(
"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\"\n" +"+ \"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$"
);
Thse are the conditions that the string has to match:
- Mail domain is from the list:
- www.fightclub.uk
- www.fightclub.lk
- www.fightclub.sa
- www.fightclub.cc
- www.fightclub.jp
- www.fightclub.se
- www.fightclub.xy
- www.fightclub.gi
- www.fightclub.rl
- www.fightclub.ss
- username has 3 to 6 characters(only lowercase English letters and numbers)
examples:
sonia6@fightclub.com
is valid
am@fightclub2.lk
is invalid