I have this regular expression for email validation:
/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
But this is not working for emails like:
test+1@gmail.com
How do I change the above regular expression for this requirement?
I have this regular expression for email validation:
/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
But this is not working for emails like:
test+1@gmail.com
How do I change the above regular expression for this requirement?
You forgot to add RegEx for the '+' symbol
^\w+([\.+-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$
+
was not icluded in your regex pattern. I have added that. Hope this works.
^\w+([\.\-\+]?\w*)*@\w+([\.-]?\w+)*(\.\w{2,3})+$