From efbe3a32e2eab05356227d56366339bf33edacda Mon Sep 17 00:00:00 2001 From: Lars Wallenborn Date: Tue, 16 Jun 2015 12:30:44 +0200 Subject: [PATCH] typo the a is covered by a-z in the regex --- cookbook/validation/custom_constraint.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/validation/custom_constraint.rst b/cookbook/validation/custom_constraint.rst index 68e2f464639..a248a8494aa 100644 --- a/cookbook/validation/custom_constraint.rst +++ b/cookbook/validation/custom_constraint.rst @@ -64,7 +64,7 @@ The validator class is also simple, and only has one required method ``validate( { public function validate($value, Constraint $constraint) { - if (!preg_match('/^[a-zA-Za0-9]+$/', $value, $matches)) { + if (!preg_match('/^[a-zA-Z0-9]+$/', $value, $matches)) { // If you're using the new 2.5 validation API (you probably are!) $this->context->buildViolation($constraint->message) ->setParameter('%string%', $value)