matches function

bool matches(
  1. String str,
  2. String pattern
)

check if string matches the pattern.

Implementation

bool matches(String str, String pattern) {
  RegExp re = RegExp(pattern);
  return re.hasMatch(str);
}