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

Re: two regexp related questions

Subject: Re: two regexp related questions
From: Brandon Ibach <brandon.ibach@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 May 2011 14:51:43 -0400
Re:  two regexp related questions
For 2), if you're using the regex to both validate the input (making
sure it conforms to the required syntax) and parse/extract the
name/value pairs, you might be able to make the job easier by breaking
these two tasks apart.  Use the regex as you have it now to validate
the input and then, if it matches, use a shorter regex that matches
just a single name/value pair with analyze-string to do the actual
processing.

-Brandon :)


On Thu, May 19, 2011 at 1:45 PM, Julian Reschke <julian.reschke@xxxxxx>
wrote:
> Hi there,
>
> I've got two regexp-related questions.
>
> 1) Is it correct that XSLT/XPath2's regular expressions do not support
> non-capturing groups (as shown in
> <http://www.exampledepot.com/egs/java.util.regex/NoGroup.html>)?
>
> 2) With respect to analyze-string, and the captured regex-groups:
>
> I'm using a regex like
>
>  ([A-Z]+) = ([A-Z]+) ( ; ([A-Z]+) = ([A-Z]+) )*
>
> for matching things like
>
>  a=b;c=d;e=f
>
> Works fine, but the regex-group function only returns values for the last
> match, so, with the example above, I can capture
>
>  a=b (because it's a non-repeating part)
>
> and
>
>  e=f
>
> I've worked around this by using recursion, feeding the "remainder" into
> another template.
>
> Is there a simpler way to achieve this?
>
> Best regards, Julian

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.