JsFormValidatorBundle icon indicating copy to clipboard operation
JsFormValidatorBundle copied to clipboard

Regex match=false is ignored

Open abienvenu opened this issue 11 years ago • 0 comments

Using this constraint with JsFormValidator v1.2.1 :

/**
 * @Assert\Regex(
 *     pattern="/\d/",
 *     match=false,
 *     message="Your name cannot contain a number"
 * )
 */

The javascript error message will appear when the name does NOT contain a number.

Of course there is a workaround :

/**
 * @Assert\Regex(
 *     pattern="/^[^\d]*$/",
 *     message="Your name cannot contain a number"
 * )
 */

But it would be great if JsFormValidator could support "match=false".

abienvenu avatar Sep 19 '14 08:09 abienvenu