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