The REGEXPREPLACE function performs regular expression pattern matching on the input string, replacing matches with the specified replacement string.
Input | Data Type | Description |
---|---|---|
Input1 | String | The input string. |
Input2 | String | Sets the RegExp property. (optional) |
Input3 | String | Sets the Replace property. (optional) |
Output | Data Type | Description |
---|---|---|
Output1 | String | The modified string. |
Name | Property Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
RegExp | String | The regular expression used to locate the data to be replaced. | ||||||||
Replace | String | 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.
|
||||||||
CaseInsensitive | Boolean |
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. |
||||||||
Global | Boolean |
Specifies which matches are to be replaced.
true - All matches are to be replaced. false - Only the first match is to be replaced. |
||||||||
EnableMetaCharacter | Boolean |
If set to true, meta characters may be used in the Replace property.The following meta characters can be used.
|
Global=false
, only the first matching "abc" is replaced. If Global=true
, each match is replaced.
Property | Output | |||
Input1 | abc def hij abc | RegExp | abc | ZZZ def hij abc |
Replace | ZZZ | |||
CaseInsensitive | true | |||
Global | false |
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.
Property | Output | |||
Input11 | (1,2) (2,3) (3,4) | RegExp | \(([0-9]),([0-9])\) | (2,1) (3,2) (4,3) |
Replace | ($2,$1) | |||
CaseInsensitive | true | |||
Global | true |