matches static method

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

Return whether input matches the regex. 返回输入是否匹配正则表达式。

Implementation

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