str:match and global option

Mansour <[email protected]> Sun, 10 Feb 2008 13:52:18 -0400
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
I am a little confused about the spec of the str:match function 
http://www.exslt.org/regexp/functions/match/index.html.
First thing I am not I fully understand the submatch concept. What is 
searched for what? The second thing is the global option in the 
examples. The first example says:
================================

The following example illustrates a non-global match:

<xsl:for-each select="regExp:match('http://www.bayes.co.uk/xml/index.xml?/xml/utils/rechecker.xml', 
                                   '(\w+):\/\/([^/:]+)(:\d*)?([^# ]*)')">
   Part <xsl:value-of select="position()" /> = <xsl:value-of select="." />
</xsl:for-each>
      

Gives the following result:

Part 1 = http://www.bayes.co.uk/xml/index.xml?/xml/utils/rechecker.xml
Part 2 = http
Part 3 = www.bayes.co.uk
Part 4 =
Part 5 = /xml/index.xml?/xml/utils/rechecker.xml
      

=================================

If I am not wrong, shouldn't the result be

"Part 1 = http://www.bayes.co.uk/xml/index.xml?/xml/utils/rechecker.xml"
As it's none global match ??
Can someone clarify this to me please ??