Underscore not accepted in xml scheme for email address

Hi, I have created a diagram and the following template for checking email id:

\w+([-+._]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*. 

However, it does not accept an email identifier containing an underscore, such as bob_t@example.com . Can you change this template so that it accepts _ too.

thanks

0
source share
1 answer

Something like the following should work (I removed some other obvious errors or features):

 \w[-+._\w] +@ \w[-.\w]+\.\w[-.\w]+ 

however, keep in mind that any template you choose will always exclude some valid email addresses (the email standard is very broad), at the same time you can include some invalid ones.

+1
source

All Articles