Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email rule is missing some constraints #222

Open
alihabbash opened this issue Sep 12, 2018 · 2 comments
Open

Email rule is missing some constraints #222

alihabbash opened this issue Sep 12, 2018 · 2 comments

Comments

@alihabbash
Copy link

I have applied the email annotation to a TextInputlayout after register a ViewDataAdapter but the email validator is accepting emails with scheme like some@exa (Without the .com .org ...etc).

@nstdio
Copy link

nstdio commented Feb 8, 2019

@alihabbash same is here. I'm using version 2.0.3, also @Email does accept inputs like [email protected].

@nstdio
Copy link

nstdio commented Feb 8, 2019

As a workaround we could use @Pattern

public static final String EMAIL_ADDRESS_PATTERN = "[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}\\@[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}(\\.[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25})+";

@Pattern(regex = EMAIL_ADDRESS_PATTERN)
TextInputEditText email;

The email address pattern was take from here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants