change regex for email addresses
This commit is contained in:
parent
c5e499c1bd
commit
e1872ea6d6
2 changed files with 4 additions and 2 deletions
|
|
@ -65,7 +65,8 @@ class _MIHTextFieldState extends State<MIHTextField> {
|
|||
}
|
||||
|
||||
bool isEmailValid(String email) {
|
||||
return RegExp(r'^[\w-\.]+@[a-zA-Z]+\.[a-zA-Z]{2,}$').hasMatch(email);
|
||||
var regex = RegExp(r'^[a-zA-Z0-9]+@[a-zA-Z.-]+\.[a-zA-Z]{2,}$');
|
||||
return regex.hasMatch(email);
|
||||
}
|
||||
|
||||
void _onFocusChange() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue