# classes/phing/tasks/ext/ReplaceRegexpTask.php

ReplaceRegExp is a directory based task for replacing the occurrence of a given regular expression with a substitution pattern in a selected file or set of files.

``

author
  Jonathan Bond-Caron
link
  http://ant.apache.org/manual/OptionalTasks/replaceregexp.html
package
  phing.tasks.system
version
  $Id: ReplaceRegexpTask.php 1110 2011-05-23 16:00:43Z mrook $

## \ReplaceRegexpTask
jump to top

ReplaceRegExp is a directory based task for replacing the occurrence of a given regular expression with a substitution pattern in a selected file or set of files.

``

Extends from
  \Task
author
  Jonathan Bond-Caron
copyright
  2001,2002 THYRELL. All rights reserved
link
  http://ant.apache.org/manual/OptionalTasks/replaceregexp.html
package
  phing.tasks.system
version
  $Id: ReplaceRegexpTask.php 1110 2011-05-23 16:00:43Z mrook $

### Properties

`\RegularExpression $_regexp= ''`

Regular expression

Details

Type
  \RegularExpression

`$file= ''`

Single file to process.

Details

Type

`$filesets= 'array'`

Any filesets that should be processed.

Default value `array` Details

Type

### Methods

`createFileSet( ) :`
Nested creator, adds a set of files (nested fileset attribute).
`init( ) :`
`main( ) :`
`setByline( bool $yesNo ) :`
Match only per line
Parameters

Name | Type | Description
--- | --- | ---
$yesNo | bool |

`setFile( string $path ) :`
File to apply regexp on
Parameters

Name | Type | Description
--- | --- | ---
$path | string |

`setFlags( string $flags ) :`
Sets the regexp flags
Parameters

Name | Type | Description
--- | --- | ---
$flags | string |

`setMatch( string $regexp ) :`
Sets the regexp match pattern
Parameters

Name | Type | Description
--- | --- | ---
$regexp | string |

`setPattern( $regexp ) :`
Parameters

Name | Type | Description
--- | --- | ---
$regexp |  |

Details

see
  \setMatch()

`setReplace( string $string ) :`
Sets the replacement string
Parameters

Name | Type | Description
--- | --- | ---
$string | string |

Documentation was generated by DocBlox 0.13.1.