I have this bit of code implemented with symfony:
$p1 = '/^[0-9]{8}[A-Z]$/i';
$p2 = '/^[XYZ][0-9]{7}[A-Z]$/i';
$this->setValidators(array(
...
'field_1' => new sfValidatorRegex(
array('pattern' => p1.'|'.p2)),
...
The field_1 must match either pattern p1 or p2, but it doesn't work. Any help please.