regular expression for email validation in Java

后端 未结 6 1164
渐次进展
渐次进展 2020-12-05 08:46

I am using the follwoing regular expression

(\".+@.+\\\\.[a-z]+\")

Bit it accepts #@#.com as a valid email. What\'s the pattern I should u

6条回答
  •  醉话见心
    2020-12-05 09:42

    I usually use the following one:

    ([a-zA-Z0-9]+(?:[._+-][a-zA-Z0-9]+)*)@([a-zA-Z0-9]+(?:[.-][a-zA-Z0-9]+)*[.][a-zA-Z]{2,})
    

提交回复
热议问题