Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Validation / Plugin / Validation / Constraint / RegexConstraint.php
1 <?php
2
3 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
4
5 use Symfony\Component\Validator\Constraints\Regex;
6
7 /**
8  * Regex constraint.
9  *
10  * Overrides the symfony constraint to use Drupal-style replacement patterns.
11  *
12  * @Constraint(
13  *   id = "Regex",
14  *   label = @Translation("Regex", context = "Validation")
15  * )
16  */
17 class RegexConstraint extends Regex {
18
19   public $message = 'This value is not valid.';
20
21   /**
22    * {@inheritdoc}
23    */
24   public function validatedBy() {
25     return '\Symfony\Component\Validator\Constraints\RegexValidator';
26   }
27
28 }