Hello who just have come.
I'm learning JavaScript RegExp rules. And i have wrote email validation pattern. But unfortunatley it allowing double "@" in examples.
Please help me to improve it.
^(?:\s|(?:[a-z]))(?:[a-zA-Z0-9]+.)+@(?:[a-zA-Z])+.[a-z]+\s+
Also screenshot available:
The reason that your regex allows second @
is .
character:
^(?:\s|(?:[a-z]))(?:[a-zA-Z0-9]+.)+@(?:[a-zA-Z])+.[a-z]+\s+
^
It allows any character. Just escape it with \.
to make it dot-only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With