712. Class

712.1. Zend\Filter\PregReplace

712.1.1. Methods

712.1.1.1. __construct

__construct()

Constructor Supported options are

‘pattern’ => matching pattern ‘replacement’ => replace with this
Parameters:array|Traversable|string|null

712.1.1.2. setPattern

setPattern()

Set the regex pattern to search for

Parameters:string|array
  • same as the first argument of preg_replace
Return type:PregReplace
Throws :ExceptionInvalidArgumentException

712.1.1.3. getPattern

getPattern()

Get currently set match pattern

Return type:string|array

712.1.1.4. setReplacement

setReplacement()

Set the replacement array/string

Parameters:array|string
  • same as the second argument of preg_replace
Return type:PregReplace
Throws :ExceptionInvalidArgumentException

712.1.1.5. getReplacement

getReplacement()

Get currently set replacement value

Return type:string|array

712.1.1.6. filter

filter()

Perform regexp replacement as filter

Parameters:mixed
Return type:mixed
Throws :ExceptionRuntimeException

712.1.1.7. validatePattern

validatePattern()

Validate a pattern and ensure it does not contain the “e” modifier

Parameters:string
Throws ExceptionInvalidArgumentException: