# 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

Package: phing\tasks\system

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.

Parent(s)
  \Task < \ProjectComponent
Author
  Jonathan Bond-Caron
Link
  http://ant.apache.org/manual/OptionalTasks/replaceregexp.html
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
  n/a

`$filesets= 'array()'`

Any filesets that should be processed.

Default value `array()`Details

Type
  n/a

### Methods

`createFileSet( ) : void`

Nested creator, adds a set of files (nested fileset attribute).

`getDescription( ) : void`

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`init( ) : void`

`log( ) : void`

`main( ) : void`

`maybeConfigure( ) : void`

`perform( ) : void`

`setByline( bool $yesNo ) : void`

Match only per line

Parameters

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

`setDescription( ) : void`

`setFile( string $path ) : void`

File to apply regexp on

Parameters

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

`setFlags( string $flags ) : void`

Sets the regexp flags

Parameters

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

`setLocation( ) : void`

`setMatch( string $regexp ) : void`

Sets the regexp match pattern

Parameters

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

`setOwningTarget( ) : void`

`setPattern( $regexp ) : void`

Parameters

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

Details

See
  \setMatch()

`setProject( ) : void`

`setReplace( string $string ) : void`

Sets the replacement string

Parameters

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

`setRuntimeConfigurableWrapper( ) : void`

`setTaskName( ) : void`

`setTaskType( ) : void`

Documentation was generated by DocBlox 0.17.1.