matches function

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

Returns true if str matches the regex pattern.

Implementation

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