REGEXPREPLACE

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

Input/Output

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

OutputData TypeDescription
Output1StringThe modified string.

Property

NameProperty TypeDescription
RegExpstringThe regular expression used to locate the data to be replaced.
Replacestring The 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.
CaseInsensitivechoice 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.
Globalchoice Specifies which matches are to be replaced.
true - All matches are to be replaced.
false - Only the first match is to be replaced.
EnableMetaCharacterchoice 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.
true - Use meta characters.
false - Don't use meta characters.

Topic

Regular Expression Dialog

When double-click the regular expression functions, the Regular Expression Dialog is displayed. You can configure the properties and test the regular expressions.

 

 

Fields
RegexpInput regular expression property.
When the item is selected by listing the lower right of the screen, the corresponding regular expression is set.
Input stringInput the string to be used by test.
ResultThe result of test is displayed.
Other propertyProperties of editing function is displayed except for regular expression.
Selection listIf selects the category, regular expressions are displayed below.
The corresponding regular expression is reflected in the input column when the item is selected from the list, and the explanation is displayed under the screen.
Test buttonTest the current configurations with Input string.
Edit sample buttonEdits the regular expression list of Selection List.

 

Regular expression list is simple CSV file and it is freely customizable.

 

Specification of regular expression sample data

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
Input1(1,2) (2,3) (3,4)RegExp\(([0-9]),([0-9])\)(2,1) (3,2) (4,3)
Replace($2,$1)
CaseInsensitivetrue
Globaltrue