# classes/phing/filters/LineContainsRegexp.php

## \LineContainsRegexp
jump to top

Filter which includes only those lines that contain the user-specified regular expression matching strings.

Example:

Or:

This will fetch all those lines that contain the pattern `foo`

Extends from
  \BaseParamFilterReader
Implements
  \ChainableReader
see
  \FilterReader
author
  Yannick Lecaillez
author
  Hans Lellelid
copyright
  © 2003 seasonfive. All rights reserved
package
  phing.filters
version
  $Revision: 526 $

### Constants

`string REGEXP_KEY = 'regexp'`

Parameter name for regular expression.

  string

### Properties

`array $_regexps= 'array'`

Regular expressions that are applied against lines.

Default value `array` Details

Type
  array

### Methods

`_initialize( ) :`
Parses parameters to add user defined regular expressions.
`chain( object $reader ) : object`
Creates a new LineContainsRegExp using the passed in Reader for instantiation.
Parameters

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

Returns

Type | Description
--- | ---
object |

`createRegexp( ) : object`
Adds a `regexp` element.
Returns

Type | Description
--- | ---
object |

`getRegexps( ) : array`
Returns the array of regular expressions which must be contained within a line read from the original stream in order for it to match this filter.
Returns

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

`read( $len = null ) : mixed`
Returns all lines in a buffer that contain specified strings.
Parameters

Name | Type | Description
--- | --- | ---
$len |  |

Returns

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

`setRegexps( \regexps $regexps ) :`
Sets the vector of regular expressions which must be contained within a line read from the original stream in order for it to match this filter.
Parameters

Name | Type | Description
--- | --- | ---
$regexps | \regexps | An array of regular expressions which must be contained within a line in order for it to match in this filter. Must not be `null`.

Documentation was generated by DocBlox 0.13.1.