본문 바로가기

IT/Flutter

[Flutter] RegExp for Email.

r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)"


if (!RegExp(r'(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)')
.hasMatch(value)) {
return 'Email should be mail format.';
}