standard.lib.regex.regex_replace

regex_replace is available since version 1.0.

Prototype:

string regex_replace(string string_to_parse, string replace_string, string pattern)

Parameters

string_to_parse
the subject string
replace_string
the replacement string
pattern
the pattern

Description:

Replace regular expression. This function scans string_to_parse for matches to pattern, then replaces the matched text with replace_string.
The modified string is returned. (Which may mean that the original string is returned if there are no matches to be replaced.)
If pattern contains parenthesized substrings, replacement may contain substrings of the form \\digit, which will be replaced by the text matching the digit'th parenthesized substring; \\0 will produce the entire contents of string. Parentheses may be nested, in which case they are counted by the opening parenthesis.
If no matches are found in string, then string will be returned unchanged.

Return value:

Returns the modified string.