matches function

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

Check if a string matches a given regex pattern.

Implementation

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