email static method

bool email(
  1. String string
)

Check if a string is an email.

Implementation

static bool email(String string) {
  RegExp regex =
      RegExp(r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b');
  return regex.hasMatch(string);
}