Hi all, am trying to interpret the following
Code:
if(!getEmail().matches("^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$"))
{
errors.add("name",new ActionMessage("email.invalid") );
}
and my interpretation is
Code:
^[a-zA-Z] must start with a letter(s)
[\\w\\.-]* can be followed by a number of characters including/ending with a dot or hyphen
[a-zA-Z0-9]@ must have a letter(s) and should be followed by '@'
[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9] same as above (a string which may contain a dot or hyphen
\\. a dot must exist
[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$" a string which may contain a dot but must end with word characters
Have a question, does these dots [\.] within brackets suggests that i can have dots in my address i.e [email protected] ?