xsl-list
[Top] [All Lists]

[xsl] two regexp related questions

2011-05-19 12:46:17
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>