hasMatch function
Checks if a string matches a specified pattern.
This function returns true if the s string matches the specified regular expression pattern p.
If the s string is null, it returns false.
Implementation
bool hasMatch(String? s, String p) =>
(s == null) ? false : RegExp(p).hasMatch(s);