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)