I am using Zend Frameworks Validation feature and am having trouble getting the Regex validator to work.
array(
'name' => 'Regex',
'options' => array(
'pattern' => '[0-9a-zA-Z\s\'\.;\-]+',
'messages' => array(
\Zend\Validator\Regex::INVALID_CHARACTERS => "Invalid characters in address"
)
),
)
I have various strings that need to accept letters, numbers, spaces and various characters, and I am using the code above for the various fields.
I've been reading framework.zend.com which doesn't give much detail.
My question is: Am I doing it correctly? Is this how to use regex validator with Zend? Any better examples of this floating around the web?
Thanks guys...