API Documentation

Filter/PregReplace.php

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Filter  
version
$Id: PregReplace.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Filter_PregReplace

Implements
\Zend_Filter_Interface
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Filter  

Properties

Propertyprotectedmixed  $_matchPattern= 'null'

Pattern to match

Default valuenullDetails
Type
mixed
Propertyprotectedmixed  $_replacement= ''

Replacement pattern

Details
Type
mixed
Propertyprotectedbool  $_unicodeSupportEnabled= 'null'
static

Is unicode enabled?

Default valuenullDetails
Type
bool

Methods

methodpublic__construct( string|array $options = null ) : void

Constructor Supported options are 'match' => matching pattern 'replace' => replace with this

Parameters
Name Type Description
$options string|array
methodprotected_determineUnicodeSupport( ) : bool
static

Method to cache the regex needed to determine if unicode support is available

Returns
Type Description
bool
methodpublicfilter( string $value ) : string

Perform regexp replacement as filter

Parameters
Name Type Description
$value string
Returns
Type Description
string
Throws
Exception Description
\Zend_Filter_Exception If filtering $value is impossible
methodpublicgetMatchPattern( ) : string

Get currently set match pattern

Returns
Type Description
string
methodpublicgetReplacement( ) : string

Get currently set replacement value

Returns
Type Description
string
methodpublicisUnicodeSupportEnabled( ) : bool
static

Is Unicode Support Enabled Utility function

Returns
Type Description
bool
methodpublicsetMatchPattern( mixed $match ) : \Zend_Filter_PregReplace

Set the match pattern for the regex being called within filter()

Parameters
Name Type Description
$match mixed
  • same as the first argument of preg_replace
Returns
Type Description
\Zend_Filter_PregReplace
methodpublicsetReplacement( mixed $replacement ) : \Zend_Filter_PregReplace

Set the Replacement pattern/string for the preg_replace called in filter

Parameters
Name Type Description
$replacement mixed
  • same as the second argument of preg_replace
Returns
Type Description
\Zend_Filter_PregReplace
Documentation was generated by DocBlox 0.13.3.