Returns true if str matches the regex pattern.
true
str
pattern
bool matches(String str, String pattern) => RegExp(pattern).hasMatch(str);