bool matches(String value) { if (value.isEmpty) { return false; } return RegExp( regexPattern, caseSensitive: caseSensitive, multiLine: multiLine, ).hasMatch(value); }