# EXSLT - regexp:replace - Implementer Page

Version: 1 Status: new User Page: index.html XML Definition: regexp.replace.xml Function Package: regexp.replace.zip #### Function Syntax
    string regexp:replace(string, string, string, string)
The `regexp:replace` function replaces the parts of a string that match a regular expression with another string. 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: `g`: global replace - all occurrences of the regular expression in the string are replaced. If this character is not present, then only the first occurrence of the regular expression is replaced. `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:replace` is available in the following XSLT processors:
Processor | Processor Version | Implemented Version
--- | --- | ---
4XSLT, from 4Suite. | 0.12.0a3 | 1
The following implementations of `regexp:replace` are available:
Language | Implemented Version | Creator | Date | Download
--- | --- | --- | --- | ---
Javascript | 1 | Chris Bayes | 2001-06-24 | regexp.replace.js
Msxsl | 1 | Chris Bayes | 2001-06-24 | regexp.replace.msxsl.xsl
## Use Cases Use Case Package: regexp.replace.use-cases.zip The following use cases illustrate the functionality of `regexp:replace`.
Details | Calling Stylesheet | XML Data | Expected Result | Category | Template
--- | --- | --- | --- | --- | ---
1 | regexp.replace.1.xsl | regexp.replace.data.1.xml | regexp.replace.result.1.xml | example | N
## Change History Submitted: 2001-06-24 Creator: Chris Bayes(http://www.bayes.co.uk) Replaces according to a regular expression.
Version | Modified | By | Details
--- | --- | --- | ---
1.1 | 2002-08-20 | Craig Stewart | Added 4XSLT implementation to the list.
1.2 | 2002-11-12 | Craig Stewart | Updated 4XSLT version to 0.12.0a3.

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