
fn:regex-group( $group-number as xs:integer ) as xs:string
While the xsl:matching-substring instruction is active,
a set of current captured substrings is available, corresponding to the
parenthesized sub-expressions of the regular expression. These captured
substrings are accessible using the function regex-group. This function
takes an integer argument to identify the group, and returns a string
representing the captured substring.
This function is only available in XSLT; it is not available in XQuery or JavaScript.
| Parameters | |
|---|---|
| group-number | The group number to return. |
The function returns the zero-length string if there is no captured substring with the relevant number. This can occur for a number of reasons:
See the examples in the xsl:analyze-string section of
the XSLT Specification.