Closed cyberwombat closed 6 years ago
It's not possible atm, but you can create your own validation rule and do whatever you want
ValidatorForm.addValidationRule('customRegexp', (value) => {
const regex = new RegExp('ab+c', 'i');
return regex.test(value);
});
I don't see how one can pass a regex? For example I am wanting to use modifiers such as the case insensitive 'i' but
['matchRegep:/^[a-z0-9]+$/i']
gets handled as a string and doesn't work. I saw an issue on formsy react with a similar unanswered question so perhaps it stems from that.I am able to do what I need using
[A-Za-z0-9]
for my needs so this is more of a general curiosity question.