Definition at line 33 of file PregReplace.php.
◆ __construct()
__construct |
( |
|
$options = null | ) |
|
Constructor Supported options are 'match' => matching pattern 'replace' => replace with this
- Parameters
-
- Returns
- void
Definition at line 87 of file PregReplace.php.
95 $temp[
'match'] = array_shift(
$options);
99 $temp[
'replace'] = array_shift(
$options);
105 if (array_key_exists(
'match',
$options)) {
109 if (array_key_exists(
'replace',
$options)) {
setReplacement($replacement)
◆ _determineUnicodeSupport()
static _determineUnicodeSupport |
( |
| ) |
|
|
staticprotected |
Method to cache the regex needed to determine if unicode support is available
- Returns
- bool
Definition at line 73 of file PregReplace.php.
75 self::$_unicodeSupportEnabled = (@preg_match(
'/\pL/u',
'a')) ?
true :
false;
◆ filter()
Perform regexp replacement as filter
- Parameters
-
- Returns
- string
Implements Zend_Filter_Interface.
Definition at line 164 of file PregReplace.php.
166 if ($this->_matchPattern ==
null) {
167 #require_once 'Zend/Filter/Exception.php'; 171 return preg_replace($this->_matchPattern, $this->_replacement,
$value);
◆ getMatchPattern()
Get currently set match pattern
- Returns
- string
Definition at line 131 of file PregReplace.php.
◆ getReplacement()
Get currently set replacement value
- Returns
- string
Definition at line 153 of file PregReplace.php.
◆ isUnicodeSupportEnabled()
static isUnicodeSupportEnabled |
( |
| ) |
|
|
static |
Is Unicode Support Enabled Utility function
- Returns
- bool
Definition at line 59 of file PregReplace.php.
61 if (self::$_unicodeSupportEnabled ===
null) {
static $_unicodeSupportEnabled
static _determineUnicodeSupport()
◆ setMatchPattern()
setMatchPattern |
( |
|
$match | ) |
|
Set the match pattern for the regex being called within filter()
- Parameters
-
mixed | $match | - same as the first argument of preg_replace |
- Returns
- Zend_Filter_PregReplace
Definition at line 120 of file PregReplace.php.
122 $this->_matchPattern = $match;
◆ setReplacement()
setReplacement |
( |
|
$replacement | ) |
|
Set the Replacement pattern/string for the preg_replace called in filter
- Parameters
-
mixed | $replacement | - same as the second argument of preg_replace |
- Returns
- Zend_Filter_PregReplace
Definition at line 142 of file PregReplace.php.
◆ $_matchPattern
◆ $_replacement
◆ $_unicodeSupportEnabled
$_unicodeSupportEnabled = null |
|
staticprotected |
The documentation for this class was generated from the following file: