开发者

Underscore not accepting in xml schema for email address

开发者 https://www.devze.com 2023-01-02 00:55 出处:网络
Hi I have created a schema and the following pattern to check for email id: \\w+([-+._]\\w+)*@\\w+([-.]\\w+开发者_Python百科)*\\.\\w+([-.]\\w+)*.

Hi I have created a schema and the following pattern to check for email id:

\w+([-+._]\w+)*@\w+([-.]\w+开发者_Python百科)*\.\w+([-.]\w+)*.

However it is not accepting email id's containing underscore like bob_t@example.com. Can you please modify this pattern so that it accepts _ too.

Thanks


Something like the following should work (I removed some other apparent errors or idiosyncrasies):

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

however, be aware that whatever pattern you choose, you'll always exclude some valid email-addresses (the email address standard is very wide) while at the same time you may be including some invalid ones.

0

精彩评论

暂无评论...
验证码 换一张
取 消