hasMatch static method
Checks if a given value matches a pattern using a regular expression.
Returns true if the value matches the pattern, false otherwise.
Implementation
static bool hasMatch(String? value, String pattern) => switch (value) {
null => false,
_ => RegExp(pattern).hasMatch(value)
};