I need a regex to match an email which:
- must contain at least one alphabet
- can contain digits
- can contain
_and.. - must be an email format (i.e., contains @something.something)
I have found this
^((?=.*[a-zA-Z])\w+([\.-]?\w+)*)@\w+([\.-]?\w+)*(\.\w{2,3})+$
but it is accepting 12345@gmail.com, which is invalid according to my specs
>Solution :
As per your specs I’ve created the following Regex for you
^\w*[A-Za-z]+(?:([._]?\w+)*)\@[A-Za-z]\w*[-]?\w+\.[A-Za-z]{1,}?(\.?[A-Za-z]+)$
It should work for all your edge cases, and it also covers all the domain names including with - like former-player and also .co.uk and such