The macro searches the value of the specified property using the specified regular expression and replaces matches with the replacement value specified.

Attributes

The following table describes the macro specific attributes for the macro:

Macro Specific Attributes
Attribute Description Required
flags An optional string that contains any combination of the following characters:
g
Global match - Find all matches rather than stopping after the first match.
i
Ignore case - If u flag is also enabled, use Unicode case folding.
m
Multiline - Treat beginning and end characters (^ and $) as working over multiple lines.
s
Dot all - Allows . to match newlines.
u
Unicode - Treat pattern as a sequence of Unicode code points.
y
Sticky - Matches only from the index indicated by the lastIndex property of this regular expression in the target string. Does not attempt to match from any later indexes.
No
property The name of the property whose value is to be searched and altered. Yes
regex A string that specifies the pattern of the regular expression. Yes
value The replacement value. Yes

Notes

None

Examples

<ReplaceRegex
    property="propertyName"
    regex="o."
    value="@@@@"
/>
    
Result:
Before: The quick brown fox jumps over the lazy dog
After:  The quick br@@@@n fox jumps over the lazy dog


<ReplaceRegex
    property="propertyName"
    regex="o."
    flags="g"
    value="@@@@"
/>
    
Result:
Before: The quick brown fox jumps over the lazy dog
After:  The quick br@@@@n f@@@@ jumps @@@@er the lazy d@@@@