Replaces a string matching the regular expression with a string matching the other regular expression.
By default, util.REGEX.replace() replaces only the 1st occurrence of the necessary string.
To replace more than one occurrence, you must use this modifier - g.
Syntax:
util.regex.replace(s STRING, re REGEX, fmt STRING) RETURNING rpl STRING
Parameters:
|
re |
input string |
|
s |
regular expression that will be matched against the input string |
|
fmt |
format of the replacing string |
Returned values:
Returns a string with the made replacements.
Usage and examples:
DEFINE regex util.REGEX
DEFINE rs, rpl STRING
...
LET regex = /a|e|i|o|u/
CALL util.REGEX.replace(rs, regex,"[$&]")
...
The examples above were taken from the example program.