hasMatch method

bool hasMatch(
  1. String pattern
)

Checks whether the string matches a given regex pattern.

Example:

print('hello123'.hasMatch(r'\d+')); // true

Implementation

bool hasMatch(String pattern) => RegExp(pattern).hasMatch(this);