Re: [xsl] Regex groups / was: Re: [xsl] Move leading/trailing spaces outside (XSLT 2.0)

Subject: Re: [xsl] Regex groups / was: Re: [xsl] Move leading/trailing spaces outside (XSLT 2.0)
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 06 Feb 2007 17:57:42 +0100
Yves Forkl wrote:

Though familiar with RegExp functions in various languages, I am not sure how this one works, so I wonder what happens when the condition of the first regex group cannot be satisfied. Supposing that the second matches, will I then have to refer to it as regex-group(1) or still as regex-group(2)? I.e., do the numbers index the groups defined in the regex or the substrings that actually matched one of the groups?

The group-number argument refers to the number of subexpressions in parentheses. If the subexpression does not match anything then regex-group(index) returns the empty string
<http://www.w3.org/TR/xslt20/#function-regex-group>


--

	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread