# mappers/RegexpMapper.php

## \RegexpMapper
jump to top

Package: phing\mappers

Uses regular expressions to perform filename transformations.

Implements
  \FileNameMapper
Author
  Andreas Aderhold
Author
  Hans Lellelid
Version
  $Revision: 526 $

### Properties

`\Regexp $reg= ''`

The Regexp engine.

Details

Type
  \Regexp

`string $to= ''`

Details

Type
  string

### Methods

`__construct( ) : void`

`main( mixed $sourceFileName ) : array`

The mapper implementation.

Parameters

Name | Type | Description
--- | --- | ---
$sourceFileName | mixed | The data the mapper works on.

Returns

Type | Description
--- | ---
array | The data after the mapper has been applied; must be in array format (for some reason).

`replaceReferences( string $source ) : void`

Replace all backreferences in the to pattern with the matched groups.

groups of the source.

Parameters

Name | Type | Description
--- | --- | ---
$source | string | The source filename.

`setFrom( string $from ) : void`

Sets the "from" pattern. Required.

Parameters

Name | Type | Description
--- | --- | ---
$from | string | On what this mapper should work

`setTo( string $to ) : void`

Sets the "to" pattern. Required.

Parameters

Name | Type | Description
--- | --- | ---
$to | string | To what this mapper should convert the from string

Documentation was generated by DocBlox 0.17.1.