replaces substrings that match a regex with another string
string viv:replace (str, pattern, newstr, replace-flags); string str; string pattern; string newstr; ""|"g"|"i"|"gi" replace-flags;
Replace the substrings in str matching the POSIX regex pattern pattern with newstr. Note that back references are NOT supported.
The default value for this parameter is the empty string, '""'.
str in which the replacement has been performed.
<xsl:value-of select="viv:replace(
document/@url,
'(domain1|domain2)\.com',
'domain3.com', 'gi')" />