$WBRXR - regular expression replace

Availability
$WBRXR is available for use with all WBSP commands.

Syntax
$WBRXR{source|pattern|strtoreplacewith|global|ignorecase}
$WBRXR[source|pattern|strtoreplacewith|global|ignorecase]

Parameters
sourcetext - text on which to perform the replacement
pattern - regular expressions pattern
strtoreplacewith - text to replace for successful match
global - optional parameter - a True/False value that indicates if a pattern should match all occurrences in an entire sourcetext or just the first one
ignorecase - optional parameter - a True/False value that indicates if a pattern search is case-sensitive or not


Returns
A copy of sourcetext with every occurrence of pattern replaced by stringtoreplacewith.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>Titles</title>
</head>
<body>
Source text: Quick brown fox jumps over the lazy dog.<br>
New text: $WBRXR[Quick brown fox jumps over the lazy dog.|fox|cat|t|t]
</body>
</html>

After running this example, the resulting page in browser, may look like this:

Source text: Quick brown fox jumps over the lazy dog.
New text: Quick brown cat jumps over the lazy dog.