RegExReplace

The RegExReplace() function replaces all matches for Pattern in SourceText, and replaces them with the ReplaceText value.

All regex functions use a pattern to check for matches in the input text.

For a more complete explanation and special / allowed characters you can visit this WEM Forum post. Here you find a cheat-sheet and a few helpful examples.

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

Returns SourceText with the matching patterns replaced by the replace-text value.

Returns SourceText if no matches are found or the pattern is faulty.

Syntax

RegExReplace(pattern, sourcetext, replacetext)

RegExReplace("\\d{3}", "Triple (3) numbers like 123 are replaced by zeroes. Some but not all of these 5-niners (99999) become zeroes, and a phonenumber like 020-2402120?", "000") => "Triple (3) numbers like 000 are replaced by zeroes. Some but not all of these 5-niners (00099) become zeroes, and a phonenumber like 000-0000000?"

Parameters

Name
Type
Required
Description

pattern

text

☑️

The pattern you want to replace.

sourcetext

text

☑️

The text you want to check for patterns to replace.

replacetext

text

☑️

The text you want to replace the pattern with.

Last updated