Uses a regular expression to search a string for a string
pattern and replace it with another. The search is

REReplaceNoCase(String, reg_expression, substring [, scope]) → returns String

Argument Reference for the REReplaceNoCase function


Required: Yes
A string or a variable that contains one


Required: Yes
Regular expression to replace.


Required: Yes
A string or a variable that contains one. Replaces


Required: No
* one: Replace the first occurrence of the regular
expression. Default.
* all: Replace all occurrences of the regular expression. Values:
  • one
  • all

Examples sample code invoking the REReplaceNoCase function

Strip Characters Using ReReplace

This example strips out all characters except a-z and 0-9.

REReplaceNoCase("test 123!", "[^a-z0-9]", "", "ALL")

Expected Result: test123

Extract Characters Using Back Reference

Uses a back reference: \1 to extract the pattern contained within the parenthesis.

REReplaceNoCase("123abc456", "[0-9]+([a-z]+)[0-9]+", "\1")

Expected Result: abc

Fork me on GitHub