matches function

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

check if string str matches the pattern.

Implementation

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