I know many of you have already read a lot of questions about regex and email, but I can't solve my problem!
I'm using Javascript and I have to check my email, everything is ok with my regular expression except one thing: it doesn't check correctly '_' char after '@'. The strange thing is that regex compilers online check it correctly, but when I use it on my webapp it goes wrong.
This is my regular expression:
[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
And here I'll write some examples:
teo@teo.teo correct match
teo@_teo.teo match fails correctly
teo@teo_teo.teo the compiler match return true, but it should fail
The problem, as I wrote before, is that some online compiler checks everything correctly.
Thank you for your help.
Matteo