Returns true if the string matches the given regular expression pattern.
bool isMatch(String pattern) => !isNullOrEmpty && RegExp(pattern).hasMatch(this!);