Java regex email

后端 未结 20 2462
清歌不尽
清歌不尽 2020-11-22 13:09

First of all, I know that using regex for email is not recommended but I gotta test this out.

I have this regex:

\\b[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]         


        
20条回答
  •  不知归路
    2020-11-22 13:30

    General Email format (RE) which include also domain like co.in, co.uk, com, outlook.com etc.

    And rule says that :

    • Uppercase and lowercase English letters (a-z, A-Z)
    • Digits 0 to 9
    • Characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~ Character.
    • (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively.

      [a-zA-Z0-9]+[._a-zA-Z0-9!#$%&'*+-/=?^_`{|}~]*[a-zA-Z]*@[a-zA-Z0-9]{2,8}.[a-zA-Z.]{2,6}
      

提交回复
热议问题