[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Aw: a sequence of regex-group()

Subject: Re: Aw: a sequence of regex-group()
From: "Geert Bormans geert@xxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Oct 2015 21:11:20 -0000
Re: Aw:  a sequence of regex-group()
Thanks Martin, 
That would definitely be a solution in an XSLT3 context (however this is XSLT2) 

----- Original Message -----

From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> 
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
Sent: Wednesday, October 28, 2015 9:52:56 PM 
Subject: Aw:  a sequence of regex-group() 

It sounds as if http://www.w3.org/TR/xpath-functions-30/#func-analyze-string might allow better control about matches and captured groups as it returns all imformation as XML. 
Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet. 

"Geert Bormans geert@xxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>schrieb: 

Hi all, 

sanity check 

If I wanted a sequence of all the regex-group() values available in a matching-substring... 

(This is inside a function and the actual regex $re is passed in as a param, so number of item() is unknown) 

I expected this to be somewhat more straightforward than this, so I check 

<xsl:variable name="group-count" select="string-length(replace($re, '[^\(]+', ''))"/> 
<xsl:analyze-string select="$str" regex="{$re}"> 
<xsl:variable name="re-groups" select="for $i in 1 to $group-count return regex-group($i)" as="item()*"/> 

Any thoughts? 

Thanks a lot 

XSL-List info and archive 
EasyUnsubscribe ( by email ) 

XSL-List info and archive 
EasyUnsubscribe ( by email ) 

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.