EXSLT - Regular Expressions

Implementer Page: regexp.html
Module Package: regexp.zip

EXSLT - Regular Expressions covers extension elements and functions that provide facilities to do with regular expressions.

For ease of implementation, the regular expressions used in this module currently use the Javascript regular expression syntax.

XSLT processors may support any number of the extension elements and functions given in this module.

Using EXSLT will only make your stylesheet portable amongst the implementations that support EXSLT. Note that there is no requirement for XSLT processors that are compliant to XSLT to support the extensions described within EXSLT.

Namespace

The namespace for EXSLT - Regular Expressions is:

http://exslt.org/regular-expressions

Throughout this document, the prefix regexp is used to refer to this namespace. Any other prefix can be used within a particular stylesheet (though a prefix must be specified to enable the extension functions to be recognised as extensions).

To use these extensions, you need to declare this namespace as an extension namespace in your stylesheet. If your processor supports this module, then that's all you need to do, but if it doesn't, then you need to use a specific third-party implementation or the module stylesheet. Typically, your stylesheet will look like:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:regexp="http://exslt.org/regular-expressions"
                extension-element-prefixes="regexp">

<xsl:import href="regexp.xsl" />

...
              
</xsl:stylesheet>

Functions

Other Functions

The following extension functions are not considered stable and are not part of the core of EXSLT - Regular Expressions. Processors that claim support of EXSLT - Regular Expressions might not support these functions.

FunctionSyntaxDownload
regexp:testboolean regexp:test(string, string, string?)regexp.test.zip
regexp:matchobject regexp:match(string, string, string?)regexp.match.zip
regexp:replacestring regexp:replace(string, string, string, string)regexp.replace.zip

http://www.exslt.org/regexp/index.html last modified 2001-06-30