regex Action
Syntax
Attributes:
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 isfit://request/content
)out="..."
to define the output location (optional, default isfit://request/content
)
Usage
The 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.
Example
This example converts a date of the form YYYY-MM-DD
into DD.MM.YY
:
Errors
If the 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.
Last updated