news | April 07, 2026

regex.replace - Documentation for BMC Discovery 21.05

regex.replace(string, pattern, replacement, count:=0)

Return a string with all non-overlapping matches of pattern replaced by replacement. If count is non-zero, then count number of replacements are made, unless fewer replacements are required in the string. The regex.replace function has the same semantics as Python re.sub. See  although note that the parameter order is different.