简体   繁体   English

我正在使用正则表达式进行电子邮件验证EMAIL_PATTERN:/ ^(\\ w +([。] \\ w +)* @ \\ w +([。] \\ w +)* \\。\\ w +([。] \\ w +)*)$ /,

[英]I am using Regex for email validation EMAIL_PATTERN:/^(\w+([.]\w+)*@\w+([.]\w+)*\.\w+([.]\w+)*)$/,

I'm Following the below Example: 我正在关注以下示例:

Email validation expression \\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)* allows empty spaces 电子邮件验证表达式\\ w +([-+。'] \\ w +)* @ \\ w +([-。] \\ w +)* \\。\\ w +([-。] \\ w +)*允许空格

I'm using EMAIL_PATTERN: 我正在使用EMAIL_PATTERN:

 `/^(\w+([.]\w+)*@\w+([.]\w+)*\.\w+([.]\w+)*)$/`

with minor changes. 稍有变化。 It is allowing me to enter the email as i want but i dont want "_" at the starting of the email address. 它允许我根据需要输入电子邮件,但我不希望在电子邮件地址的开头输入“ _”。 Example: _abc@gmail.com How to solve this? 示例: _abc@gmail.com如何解决此问题? What regex google is using in gmail? Google在Gmail中使用什么正则表达式?

用这个

/^([a-zA-Z0-9]+([.][a-zA-Z0-9]+)@\w+([.]\w+)\.\w+([.]\w+)*)$/,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM