validateNameREGX static method

bool validateNameREGX(
  1. String value
)

Implementation

static bool validateNameREGX(String value) {
  String pattern = r'[!@#$%^&*(),.?":/\[/\]/\\/{}|<>;’_+=~٠١٢٣٤٥٦٧٨٩؟0123456789-]';
  RegExp regExp = new RegExp(pattern);
  RegExp regExp2 = new RegExp(r"[']");
  bool result = !regExp.hasMatch(value)&&!regExp2.hasMatch(value);
  return result;
}