Skip to content

Instantly share code, notes, and snippets.

@valterh4ck3r
Created November 8, 2019 05:02
Show Gist options
  • Save valterh4ck3r/01b0e1525bbcae6340dcd38c5d42c322 to your computer and use it in GitHub Desktop.
Save valterh4ck3r/01b0e1525bbcae6340dcd38c5d42c322 to your computer and use it in GitHub Desktop.
Validate Email Flutter
static bool isEmail(String em) {
String p = r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
RegExp regExp = new RegExp(p);
return regExp.hasMatch(em);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment