package Default
inherited_from \Zend\Filter\AbstractFilter

 Methods

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

__construct(array|\Traversable|string|null $options = null

Parameters

$options

array\Traversablestringnull

Invoke filter as a command

__invoke(mixed $value) : mixed
Inherited

Proxies to \filter()

Parameters

$value

mixed

Exceptions

\Zend\Filter\Exception\ExceptionInterface If filtering $value is impossible

Returns

mixed

Perform regexp replacement as filter

filter(mixed $value) : mixed

Parameters

$value

mixed

Exceptions

\Zend\Filter\Exception\RuntimeException

Returns

mixed

Retrieve options representing object state

getOptions() : array
Inherited

Returns

array

Get currently set match pattern

getPattern() : string | array

Returns

stringarray

Get currently set replacement value

getReplacement() : string | array

Returns

stringarray

hasPcreUnicodeSupport()

hasPcreUnicodeSupport() : boolean
InheritedStatic
deprecated Since 2.1.0

Returns

boolean

setOptions()

setOptions(array|\Traversable $options) : \Zend\Filter\PregReplace
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

array\Traversable

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\PregReplace

Set the regex pattern to search for

setPattern(string|array $pattern) : \Zend\Filter\PregReplace
see
fluent This method is part of a fluent interface and will return the same instance

Parameters

$pattern

stringarray
  • same as the first argument of preg_replace

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\PregReplace

Set the replacement array/string

setReplacement(array|string $replacement) : \Zend\Filter\PregReplace
see
fluent This method is part of a fluent interface and will return the same instance

Parameters

$replacement

arraystring
  • same as the second argument of preg_replace

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\PregReplace

isOptions()

isOptions(mixed $options) : boolean
InheritedStatic

Parameters

$options

mixed

Returns

boolean

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

validatePattern(string $pattern) : boolean

Parameters

$pattern

string

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

boolean

 Properties

 

Filter options

$options 

Default

array('pattern' => null, 'replacement' => '')
inherited_from \Zend\Filter\AbstractFilter::options
 

Filter options

$options : array

Default

array()