matches static method

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

Returns whether the input matches the regex pattern.

Implementation

static bool matches(String regex, String input) {
  return input.isNotEmpty && RegExp(regex).hasMatch(input);
}