Visit Mozilla.org

EXSLT:regexp:replace

Un article de MDC.

Cette page est en cours de traduction, son contenu peut donc être incomplet ou contenir des parties en anglais. N'hésitez pas à participer à sa traduction à partir de EXSLT:regexp:replace
Référence XSLT/XPath : Éléments XSLT, Fonctions EXSLT, Fonctions XPath, Axes XPath

Cet article traite de fonctionnalités introduites dans Firefox 3

Sommaire


regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.

[modifier] Syntax

regexp:replace(originalString, regExpString, replaceString[, flagsString])

[modifier] Arguments

originalString
The string perform a search-and-replace operation upon.
regExpString
The JavaScript style regular expression to evaluate.
replaceString
The string with which the matched substrings are to be replaced.
flagsString
An optional string containing character flags.

The character flags are:

g - Global replace
If this flag is specified, all occurrences of the regular expression within the originalString are replaced. Otherwise only the first occurrence is replaced.
i - Case insensitive match
If this flag is specified, the match is performed in a case insensitive fashion.

[modifier] Returns

The revised version of the string.

[modifier] Defined

EXSLT - REGEXP:REPLACE

[modifier] Gecko support

Supported in Gecko 1.9 and later.