Skip to content

[Form] Pattern generated from Regex constraint is invalid #4174

Closed
@ghost

Description

When setting a validation like:

/**
 * @Assert\Regex("/^\d+/")
 */
public $phone_number;

it generate an input text with the same pattern /^\d+/. Unfortunate, that pattern is not valid with HTML5 (should be ^\d+).. I recommend updating the pattern to be HTML5 compatible then on validate form convert it into PHP preg_match which is pretty much adding the / to the start and end of the pattern string.

What do you guy's think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions