matches method
Whether value meets this rule. Empty input never does, so nothing is
ticked before the user types (e.g. ^\w*\$ or maxLength).
Implementation
bool matches(String value) =>
value.isNotEmpty && (test?.call(value) ?? regExp!.hasMatch(value));