The replace filter replaces all occurrences of many given regexs with the supplied replacements. These regexs are pulled from a file whose name is supplied as a parameter.
The replacements may refer back to capturing groups to include part(s) of the regex in the in the replacement. (See the quick regex tutorial for more details about capturing groups and other regex info.)
Optionally a prefix and/or suffix may be supplied to be added on to each regex as they are processed.
The structure for the matchfile is discussed below.
|matchfile||the file containing the regexs to be replaced||Yes|
|prefix||a regex to append to the beginning of all regexs in the matchfile||No|
|suffix||a regex to append to the end of all regexs in the matchfile||No|
<replaceList matchfile="match.txt"/>Replaces all regexs found in file "match.txt" adding a '#' to the beginning of each regex
<replaceList matchfile="match.txt" prefix="#"/>
The matchfile must be structured like a standard Java properties file. This means that each regex should be on its own line with an = between the regex and the replacment. No lines should be skiped. Any line that begins with a # is consdiered to be be a comment an will be ignored. The display should list the line number of any line that does not conform to these requirements.
Here is an example of what a matchfile could look like:
#this is a comment and will be ignored
good day=good night