hasMatch static method

bool hasMatch(
  1. String? s,
  2. String regex
)

判断内容是否符合正则

Implementation

static bool hasMatch(String? s, String regex) {
  return (s == null) ? false : RegExp(regex).hasMatch(s);
}