JSRegEx::Replace (open)

Replace every occurrence of a regular expression

Syntax

LOADLIB "wh::regex.whlib";

STRING FUNCTION Replace(STRING input, STRING replacewith)

Parameters

STRING input

Input to do the replace in

STRING replacewith

Format string to replace every occurance with

Return value

STRING

Input with every occurance of the regular expression replaced

Description

This function can be used to find every occurence of a regular expression within a string, and replace it with another string. If the global flag was set on the regular expression, the callback is only called for the first match.