matches function

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

check if string str matches the pattern.

Implementation

bool matches(String str, String pattern) => RegExp(pattern).hasMatch(str);