docdawson:
^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*){n,20}$
Doesn't this just match n to 20 e-mail addresses? I understand carlosaml wants addresses with no more than 20 characters.
The shortest possible address that will match the pattern above has 5 characters (a@b.c).
To check for 5 to 20 characters one would have to use a lookahead assertion:
^(?=.{5,20}$)\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$