EXSLT - regexp:test - Implementer Page

Version: 1
Status: new
User Page: index.html
XML Definition: regexp.test.xml
Function Package: regexp.test.zip

Function Syntax

boolean regexp:test(string, string, string?)

The regexp:test function returns true if the string given as the first argument matches the regular expression given as the second argument.

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:

  • g: global test - has no effect on this function, but is retained for consistency with regexp:match and regexp:replace.
  • i: case insensitive - the regular expression is treated as case insensitive. If this character is not present, then the regular expression is case sensitive.

An implementation of this extension function in the EXSLT regexp namespace must conform to the behaviour described in this document.

Implementations

Built-in support for regexp:test is available in the following XSLT processors:

ProcessorProcessor VersionImplemented Version
4XSLT, from 4Suite.0.12.0a31

The following implementations of regexp:test are available:

LanguageImplemented VersionCreatorDateDownload
Javascript1Chris Bayes2001-06-24regexp.test.js
Msxsl1Chris Bayes2001-06-24regexp.test.msxsl.xsl

Use Cases

Use Case Package: regexp.test.use-cases.zip

The following use cases illustrate the functionality of regexp:test.

DetailsCalling StylesheetXML DataExpected ResultCategoryTemplate
1regexp.test.1.xslregexp.test.data.1.xmlregexp.test.result.1.xmlexampleN

Change History

Submitted: 2001-06-24
Creator: Chris Bayes(http://www.bayes.co.uk)

Tests whether a string matches a regular expression.
VersionModifiedByDetails
1.12002-08-20Craig Stewart

Added 4XSLT implementation to the list.

1.22002-11-12Craig Stewart

Updated 4XSLT version to 0.12.0a3.

http://www.exslt.org/regexp/functions/test/regexp.test.html last modified 2002-11-12