Replaces bits of a string using patternmatching.
The following construct(s) refer to this construct:
fn:replace(string $input, string $pattern, string $replacement) => string
fn:matches(string $input, string $pattern, string $replacement, string $flags) => string
The function returns the input string wherein all occurrences of $pattern
are replaced by $replacement
influenced by the value of
$flags
, if present.
$input |
a string to be modified |
---|---|
$pattern |
a pattern |
$replacement |
a string to be inserted |
$flags |
modifiers for patternmatching |
For each string replace "x" with "y".
for $value in ("axa","bxb","cxc") return replace($value,"x","y")
The query returns
<xq:result> <xq:value>aya</xq:value> <xq:value>byb</xq:value> <xq:value>cyc</xq:value> </xq:result>.