# classes/phing/filters/ReplaceRegexp.php

## \ReplaceRegexp
jump to top

Performs a regexp find/replace on stream.

<

p> Example:

Extends from
  \BaseFilterReader
Implements
  \ChainableReader
author
  Hans Lellelid
package
  phing.filters
version
  $Revision: 779 $

### Properties

`array $regexps= 'array'`

RegularExpression[]
Default value `array` Details

Type
  array

### Methods

`chain( \Reader $reader ) : \ReplaceRegExp`
Creates a new ReplaceRegExp filter using the passed in Reader for instantiation.
Parameters

Name | Type | Description
--- | --- | ---
$reader | \Reader | A Reader object providing the underlying stream. Must not be `null`.

Returns

Type | Description
--- | ---
\ReplaceRegExp |

`createRegexp( ) : \RegularExpression`
Creator method handles nested tags.
Returns

Type | Description
--- | ---
\RegularExpression |

`getRegexps( ) : array`
Gets the current regexps.

(Used when, e.g., cloning/chaining the method.)

Returns

Type | Description
--- | ---
array |

`read( int $len = null ) : mixed`
Returns the filtered stream.

The original stream is first read in fully, and the regex replace is performed.

Parameters

Name | Type | Description
--- | --- | ---
$len | int | Required $len for Reader compliance.

Returns

Type | Description
--- | ---
mixed |

Details

exception
  IOException if the underlying stream throws an IOException during reading

`setRegexps( array $regexps ) :`
Sets the current regexps.

(Used when, e.g., cloning/chaining the method.)

Parameters

Name | Type | Description
--- | --- | ---
$regexps | array | RegularExpression[]

Documentation was generated by DocBlox 0.13.1.