The ReplaceRegExp
filter must contain one or more
regexp
tags. These must have pattern
and
replace
attributes. The full list of supported attributes is
as following:
Table 191. Attributes for the <regexp>
tag
Name | Type | Description | Default | Required |
---|---|---|---|---|
pattern |
String |
Regular expression used as needle. Phing relies on Perl-compatible regular expressions. | n/a | Yes |
replace |
String |
Replacement string. | n/a | Yes |
ignoreCase |
Boolean |
Whether search is case-insensitive. | false |
No |
multiline |
Boolean |
Whether regular expression is applied in multi-line mode. | false |
No |
modifiers |
String |
Raw regular expression modifiers. You can pass several modifiers as single
string, and use raw modifiers with ignoreCase and
multiline attributes. In case of conflict,
value specified by dedicated attribute takes precedence.
|
'' | No |
The previous example (using modifiers
attribute this
time):
<filterchain> <replaceregexp> <regexp pattern="ANT" replace="Phing" modifiers="i"/> <regexp pattern="(\w+)\.java" replace="\1.php"/> </replaceregexp> </filterchain>