This can be useful with IfMatchActions, if you want to for instance see if two measure have the same string value, but can't be sure that the value doesn't contain regular expression reserved characters.
A simplistic example, but as you can see both [MeasureOne] and [MeasureTwo] contain the same text. When we want to compare them with IfMatch, we need to be sure that the "[" and "+" reserved characters are "escaped" when we use them in a regular expression match in . The :EscapeRegExp section variable parameter will ensure this is done for you.
Code: Select all
[MeasureOne] Measure=String String=[Some+Text] [MeasureTwo] Measure=String String=[Some+Text] IfMatch=[MeasureOne:EscapeRegExp] IfMatchAction=[!Log "They are the same"] IfNotMatchAction=[!Log "They are different"] DynamicVariables=1
What this will actually do under the covers is:
In the example above, the "[" and "]" in the regular expression would create a "character class", and the "+" would be seen as a directive of "1 or more instances" instead of being used as literals, and would produce undesirable results.