Modules | Implementer Page: regexp.test.html Function Syntaxboolean regexp:test(string, string, string?)
The The second argument is a regular expression that follows the Javascript regular expression syntax. The third argument is a string consisting of flags to be used by the test. 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<?xml-stylesheet type="text/xsl" href="regexp.test.1.xsl" ?> <a> <c>Is this EXSLT? No. no</c> </a> Stylesheet<xsl:import href="regexp.test.msxsl.xsl" />
<xsl:template match="a">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*">
<out>
<xsl:value-of select="." />
-
<xsl:value-of select="regexp:test(string(.), 'no', 'g', 'yes!!!')" />
<xsl:value-of select="regexp:test(string(.), 'no', 'gi', 'yes!!!')" />
<xsl:apply-templates select="*" />
</out>
</xsl:template>Result<out>Is this EXSLT? No. no -
truetrue</out> |
http://www.exslt.org/regexp/functions/test/index.html last modified 2002-11-12