Return whether input matches the regex. 返回输入是否匹配正则表达式。
bool matches(String regex, String input) { if (input.isEmpty) { return false; } return RegExp(regex).hasMatch(input); }