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