I am preparing a regular expression:
[a-zA-Z0-9._-]{20}
So far I'm dealing with the pre-"@" part of an email and I'm trying to do something like this:
[a-zA-Z0-9._-]{"*"-20}
Where "*" appears I try to put that it does not have a minimum size, but a maximum
How could I mount the expression?
The idea is to use it later to do this:
Email in multi-character format (letters, numbers, periods, or underscores, 20 maximum) followed by at sign, letters (20 maximum), period (1), and 2 or 3 letters .
The solution is to use
{n,m}
(cuantificador de rango
), wheren
is the minimum number of possible occurrences andm
the maximum.Example: