Substitute replaces some or all of a string value returned by a measure with another string.
A list of comma delimited
"pattern":"replacement"pairs. All occurrences of
patternin the measure string value are replaced with
replacement. For example,
"This":"That"substitutes all occurrences of This with That.
"pattern":"replacement"pairs are specified, each substitution is attempted in the specified order. For example,
"This":"That","Here":"There"first replaces all occurrences of This with That and then replaces all occurrences of Here with There.
Each of the
"pattern":"replacement"pairs are a separate action, and act on the results of the previous substitute pairs. For example, with
"1":"One","10":"Ten", all occurrences of 1 are replaced with One, but occurrences of 10 will not be replaced with Ten, because the first substitution already changed all 1 characters to One. For the desired behavior, the order can be reversed as
"pattern":"replacement", single quotes can be used either around the pattern or the replacement. (i.e.
"pattern":'replacement', but not
'pattern':'replacement') This can be useful when either the pattern or the replacement contains double quotes. For example,
'"':"double quote"replaces all occurrences of " with double quote.
If set to
1, Perl compatible regular expressions can be used in the
If captures are used in the pattern, (e.g.
(.+)) they can be referenced in the
\1, (first capture)
\2, (second capture) etc. The entire match can also be referenced with
Note: With RegExpSubstitute, a (capture) may not return an empty string. Care should be taken when using
*(zero or more) quantifiers or
(?(?=(If/Then) lookahead tests, as a capture must either cause the entire regular expression to "fail", or return a value of some kind.
Regular expression substitution: