RegexReplace

This Flow Script tutorial explains how to use the RegexReplace function with syntax and examples.

Description

The RegexReplace function performs a Regular Expression replace on the input string, returning the result.

Syntax

‌The syntax for the RegexReplace function is:

RegexReplace(input, pattern, replacement)

Parameters

input - the string to check.

pattern - the pattern to match.

replacement - the string to replace the values where there is a match.

Returns

‌The RegexReplace function returns a string.

Example

Let's look at some RegexReplace function examples and explore how to use the RegexReplace function.‌

RegexReplace("2hello1", "\d", "X")
Result: XhelloX

return RegexReplace("22hello1", "\d{2}", "X");
Result: Xhello1

return RegexReplace("2hello1", "\w{2}", "X");
Result: XXX1

Last updated