xsl-list
[Top] [All Lists]

Re: [xsl] parsing parens in the park

2008-09-28 20:00:12


It was to me as well, and so I took it on as a challenge, but I 
couldn't see how to do it without some traditional programming 
techniques shoehorned into XSLT 2.  Perhaps someone can propose a 
regex-pure solution, but I couldn't think of one.

You can not match nested brackets with regular expressions. (That's more
or less the defining restriction which is implied by "regular").

To match brackets you need to use, in addition to regular expressions, a
language that can either count or (equivalently) has a unbounded stack.
(Eg recursive function calls).

You can match brackets to a fixed depth by regexp, but if they may occur
arbitrarily deeply nested you need to use something else in addition.

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--