isEmail property

bool get isEmail

验证是否email格式

Implementation

bool get isEmail {
  String regex = "^[a-z0-9A-Z_.-]+[a-z0-9A-Z]@([a-z0-9A-Z]+([a-z0-9A-Z_-]+)?\\.)+[a-zA-Z]{2,}\$";
  if (this.isEmptyString) {
    return false;
  }
  return RegExp(regex).hasMatch(this ?? "");
}