matches static method

bool matches(
  1. String regex,
  2. String? input
)

正则匹配

Implementation

static bool matches(String regex, String? input) {
  if (input == null || input.isEmpty) return false;
  return RegExp(regex).hasMatch(input);
}