Modules | Implementer Page: regexp.replace.html Function Syntaxstring regexp:replace(string, string, string, string)
The The first argument is the string to be matched and replaced. The second argument is a regular expression that follows the Javascript regular expression syntax. The fourth argument is the string to replace the matched parts of the string. The third argument is a string consisting of character flags to be used by the match. If a character is present then that flag is true. The flags are:
Implementations
The following XSLT processors support
Implementations of
ExamplesFunctionThe following example shows how to use the Source<a> <c>Is this EXSLT? No. no</c> </a> Stylesheet<xsl:template match="a">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*">
<out>
<xsl:value-of select="." />
-
<xsl:value-of select="regexp:replace(string(.), 'no', 'g', 'yes!!!')" />
<xsl:value-of select="regexp:replace(string(.), 'no', 'gi', 'yes!!!')" />
<xsl:apply-templates select="*" />
</out>
</xsl:template>Result<out>Is this EXSLT? No. no -
Is this EXSLT? No. yes!!!Is this EXSLT? yes!!!. yes!!!</out> |
http://www.exslt.org/regexp/functions/replace/index.html last modified 2002-11-12