symfony/symfony — pull request #4520 by lavoiesl (2012-06-08 15:05:32+00:00)
Title: [Form][Validator] Fixed generation of HTML5 pattern attribute based on Assert\Regex by removing delimiters or using a new option: html_pattern.

This is a resubmit of PR #4513.

In Issue #3766, it was asked that Assert\Regex generates HTML5 pattern attribute.
It was done in PR #4077, but the generated Regex is in delimited format which is not supported by HTML5.

Hence, `/[a-z]+/` would be converted to `[a-z]+`.
If flags are specified like in `/[a-z]+/i`, it cannot be converted and pattern validation will be disabled client-side. If is however now possible, using a new option, `html_pattern`, to specify the pattern you want to be used.

Example:

```php