matches method

bool matches(
  1. String regex
)

Implementation

bool matches(String regex) {
  if (isEmpty) return false;
  return RegExp(regex).hasMatch(this);
}