Skip to content

Regex match=false is ignored #59

@abienvenu

Description

@abienvenu

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".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions