I trying to create custom email regexp
[first]@[second].[third]
- Allowed signs are numbers, letters and some special characters (I have done it)
- One @
- First+second to be from 1 to 20 characters long.
- Email can't start or end with dot. Two or more dots next to each other are also not allowed.
- Third string to be 2 or 3 characters long.
This is what I have so far:
^(?!\.)(?=[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9]).{2,21}(?:\.[a-zA-Z0-9].{2,3})$
Unfortunately it doesn't work as I expected. Thanks for any tips.
For instance I can add multiple dots next to each other: test...s@fm.com