util/regexp/Regexp.php
A factory class for regex functions.
- Author
- Hans Lellelid
- Package
- phing.util.regexp
- Version
- $Id$
\Regexp
A factory class for regex functions.
- Author
- Hans Lellelid
- Version
- $Id$
Properties
Methods

__construct(
$engineType
=
'preg'
)
:
voidConstructor sets the regex engine to use (preg by default).
| Name | Type | Description |
|---|---|---|
| $engineType |

getGroup(
integer $idx
)
:
stringGet specific matched group.
| Name | Type | Description |
|---|---|---|
| $idx | integer |
| Type | Description |
|---|---|
| string | specified group or NULL if group is not set. |

getIgnoreCase(
)
:
booleanGets whether the regexp matching is case insensitive.
| Type | Description |
|---|---|
| boolean |

getModifiers(
)
:
stringGets pattern modifiers.
Subsequent call to engines getModifiers() filters out duplicates i.e. if i is provided in $mods, and setIgnoreCase(true), "i" modifier would be included only once
| Type | Description |
|---|---|
| string |

getMultiline(
)
:
booleanGets whether regexp is to be applied in multiline mode.
| Type | Description |
|---|---|
| boolean |

getPattern(
)
:
stringGets pattern to use for matching.
| Type | Description |
|---|---|
| string | The pattern to match on. |

getReplace(
)
:
stringGets replacement string.
| Type | Description |
|---|---|
| string | The pattern to replace matches with. |

matches(
string $subject
)
:
booleanPerforms match of specified pattern against $subject.
| Name | Type | Description |
|---|---|---|
| $subject | string | The subject, on which to perform matches. |
| Type | Description |
|---|---|
| boolean | Whether or not pattern matches subject string passed. |

replace(
string $subject
)
:
stringPerforms replacement of specified pattern and replacement strings.
| Name | Type | Description |
|---|---|---|
| $subject | string | Text on which to perform replacement. |
| Type | Description |
|---|---|
| string | subject after replacement has been performed. |

setIgnoreCase(
boolean $bit
)
:
voidSets whether the regexp matching is case insensitive.
(default is false -- i.e. case sensisitive)
| Name | Type | Description |
|---|---|---|
| $bit | boolean |

setModifiers(
string $mods
)
:
voidSets pattern modifiers for regex engine
| Name | Type | Description |
|---|---|---|
| $mods | string | Modifiers to be applied to a given regex |

setMultiline(
boolean $bit
)
:
voidSets whether regexp should be applied in multiline mode.
| Name | Type | Description |
|---|---|---|
| $bit | boolean |

setPattern(
string $pat
)
:
voidSets pattern to use for matching.
| Name | Type | Description |
|---|---|---|
| $pat | string | The pattern to match on. |