Created
April 27, 2019 18:14
-
-
Save felangel/d00012c16ec1bd47669cfb18d6630d6b to your computer and use it in GitHub Desktop.
[flutter_firbase_login] Validators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Validators { | |
static final RegExp _emailRegExp = RegExp( | |
r'^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$', | |
); | |
static final RegExp _passwordRegExp = RegExp( | |
r'^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$', | |
); | |
static isValidEmail(String email) { | |
return _emailRegExp.hasMatch(email); | |
} | |
static isValidPassword(String password) { | |
return _passwordRegExp.hasMatch(password); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment