Android Email Validation on EditText

前端 未结 13 1143
陌清茗
陌清茗 2020-12-29 04:38

I have one edittext and I would to to write email validation in my Editttext this is a xml code



        
13条回答
  •  清歌不尽
    2020-12-29 05:32

    I had a query in email pattern for more than one Email ID validation and for only one Email ID.I solved it by using :

    public static final String patter_emails="^(\\s*,?\\s*[0-9a-za-z]([-.\\w]*[0-9a-za-z])*@([0-9a-za-z][-\\w]*[0-9a-za-z]\\.)+[a-za-z]{2,9})+\\s*$";
    public static final String patter_email="^(\\s*[0-9a-za-z]([-.\\w]*[0-9a-za-z])*@([0-9a-za-z][-\\w]*[0-9a-za-z]\\.)+[a-za-z]{2,9})+\\s*$";
    

    These above is used for pattern in Java and Android both.

    check this by using:

    pattern test: rubular.com

提交回复
热议问题