Checks whether the string contains a match for the given pattern.
bool hasMatch(String pattern) => RegExp(pattern).hasMatch(this);