The replace filter replaces occurances of a given regex with the supplied replacment. Optionally only the first occurance of the rege need be replaced.
The replacment may refer to capturing groups to include part(s) of the regex in the in the replament. (See the quick regex tutorial for more details about capturing groups and other regex info.)
|regex||the regex to be searched for||Yes|
|replacment||the text to replace the regex with||Yes|
|firstOnly||indicates if all the regex matches should be replaced or only the first||No, defaults to false|
<replace regex="abc" replacement="cba"/>Replaces all decimal numbers and rounds them off to a whole
<replace regex="([0-9]+)\.[0-9]+" replacement="$1.00"/>Replaces the first occurance of cat or cats and replaces it with dog or dogs
<replace regex="cat(s)*" replacement="dog$1 firstOnly="true"/>