isPhone method
Implementation
bool isPhone() {
String pattern =
r'^(?:\(?)(\d{3})(?:[\).\s]?)(\d{3})(?:[-\.\s]?)(\d{4})(?!\d)$';
RegExp regExp = RegExp(pattern);
return regExp.hasMatch(this);
}
bool isPhone() {
String pattern =
r'^(?:\(?)(\d{3})(?:[\).\s]?)(\d{3})(?:[-\.\s]?)(\d{4})(?!\d)$';
RegExp regExp = RegExp(pattern);
return regExp.hasMatch(this);
}