According to RegExp documentation, we must use JavaScript
(Perl 5
) regular expressions : ECMA Specification. What pattern do you use for email validation in Dart? Is there any different way than JavaScript to achieve this in Dart?
For that simple regex works pretty good.
var email = "[email protected]"
bool emailValid = RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email);