We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18fa126 commit b6c188eCopy full SHA for b6c188e
lib/src/form_builder_validators.dart
@@ -267,6 +267,15 @@ class FormBuilderValidators {
267
? errorText ?? FormBuilderLocalizations.current.matchErrorText
268
: null;
269
270
+ /// [FormFieldValidator] that requires the field's value not to match the provided regex pattern.
271
+ static FormFieldValidator<String> notMatch(
272
+ String pattern, {
273
+ String? errorText,
274
+ }) =>
275
+ (valueCandidate) => true == valueCandidate?.isNotEmpty && RegExp(pattern).hasMatch(valueCandidate!)
276
+ ? errorText ?? FormBuilderLocalizations.current.matchErrorText
277
+ : null;
278
+
279
/// [FormFieldValidator] that requires the field's value to be a valid number.
280
static FormFieldValidator<String> numeric({
281
String? errorText,
0 commit comments