REGEXPREPLACE

The REGEXPREPLACE function performs regular expression pattern matching on the input string, replacing matches with the specified replacement string.

Input

Number of Connections: Min: 1/Max:3
InputData TypeDescription
Input1StringThe input string.
Input2StringSets the RegExp property. (optional)
Input3StringSets the Replace property. (optional)

Output

OutputData TypeDescription
Output1StringThe modified string.

Property

NameProperty TypeDescription
RegExpStringThe regular expression used to locate the data to be replaced.
ReplaceStringThe replacement string.

The replacement string set by this property can use macros such as $1 or $2, as seen in the example below, that represent the regular expression portion of the RegExp that appear in brackets () in the order that they appear.
CaseInsensitiveBoolean Defines whether the query distinguishes from upper and lower case characters.
true - Does not distinguish between upper and lower case.
false - Does distinguish between upper and lower case.
GlobalBoolean Specifies which matches are to be replaced.
true - All matches are to be replaced.
false - Only the first match is to be replaced.
EnableMetaCharacterBoolean If set to true, meta characters may be used in the Replace property.
The following meta characters can be used.

Meta CharacterControl Character
\tTAB
\rCR
\nLF

The "\" character can be used as an escape character. Use "\\" to output a single "\". A single "\" will result in a compile error.

Topic


Example

Example 1 : If Global=false, only the first matching "abc" is replaced. If Global=true, each match is replaced.
PropertyOutput
Input1abc def hij abcRegExpabcZZZ def hij abc
ReplaceZZZ
CaseInsensitivetrue
Globalfalse

Example 2 : The "$1" in the Replace property is a macro that refers to the string that matches the regular expression located in the first set of brackets in the RegExp property.
PropertyOutput
Input11(1,2) (2,3) (3,4)RegExp\(([0-9]),([0-9])\)(2,1) (3,2) (4,3)
Replace($2,$1)
CaseInsensitivetrue
Globaltrue