Validate/Regex.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Validate  
Version
$Id$  

\Zend_Validate_Regex

Package: Zend_Validate
Parent(s)
\Zend_Validate_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  INVALID = 'regexInvalid'
>VConstant  NOT_MATCH = 'regexNotMatch'
>VConstant  ERROROUS = 'regexErrorous'

Properties

>VPropertyprotectedarray $_messageTemplates = array(self::INVALID => "Invalid type given. String, integer or float expected", self::NOT_MATCH => "'%value%' does not match against pattern '%pattern%'", self::ERROROUS => "There was an internal error while using the pattern '%pattern%'")
Default valuearray(self::INVALID => "Invalid type given. String, integer or float expected", self::NOT_MATCH => "'%value%' does not match against pattern '%pattern%'", self::ERROROUS => "There was an internal error while using the pattern '%pattern%'")Details
Type
array
>VPropertyprotectedarray $_messageVariables = array('pattern' => '_pattern')
Default valuearray('pattern' => '_pattern')Details
Type
array
>VPropertyprotectedstring $_pattern
Regular expression pattern
Details
Type
string

Methods

methodpublic__construct(string | \Zend_Config $pattern) : void

Sets validator options

Parameters
NameTypeDescription
$patternstring | \Zend_Config
Throws
ExceptionDescription
\Zend_Validate_ExceptionOn missing 'pattern' parameter
methodpublicgetPattern() : string

Returns the pattern option

Returns
TypeDescription
string
methodpublicisValid(string $value) : boolean

Defined by Zend_Validate_Interface

Returns true if and only if $value matches against the pattern option
Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
boolean
methodpublicsetPattern(string $pattern) : \Zend_Validate_Regex

Sets the pattern option

Parameters
NameTypeDescription
$patternstring
Returns
TypeDescription
\Zend_Validate_RegexProvides a fluent interface
Throws
ExceptionDescription
\Zend_Validate_Exceptionif there is a fatal error in pattern matching
Documentation was generated by phpDocumentor 2.2.0 .