pattern="..." to define the search expression including delimiter and modifier (required)
replace="..." to set the replacement text (required)
in="..." to define the input location (optional, default is
out="..." to define the output location (optional, default is
<regex pattern="#abc$#" replace="123" /><regex in="$test" out="$test" pattern="/foo/i" replace="bar" />
regex action works on text content only. However, if the input is a DOM, it is automatically serialized into a string for the action to work. The output of this action is always a string.
The replacement is carried out with the PCRE regular expression library.
This example converts a date of the form
<regex pattern="|20(\d)-(\d\d)-(\d\d)|" replace="$3.$2.$1"/>
pattern does not compile, the request will terminate with an error.
It is not an error if the
pattern does not match or the replacement is empty.