Link Search Menu Expand Document

RegexMatcher.ReplaceAll Method

Explanation Replaces everything that matches the regular expression pattern with the specified string.
Call format var s = rm.ReplaceAll( replacement )
Return value Replaced result string
From Ver.5.0.1, UString type string is returned in Unicode mode.
Arguments String replacement Replacement string
You can use a reference to a forward reference group by "$n"
From Ver.5.0.1, it is treated as UString type in Unicode mode.
Exception Func 14 The value cannot be referenced
Example of use
var p = RegexPattern.Compile("Biz/([a-zA-Z]+)");
var m = p.Matcher("Biz/Browser, Biz/Designer");
print(m.ReplaceAll("ABC Biz/$1"), "\n");
    
Related item ReplaceFirst method