Subject: Re: [xsl] parsing parens in the park From: David Carlisle <davidc@xxxxxxxxx> Date: Sun, 28 Sep 2008 21:15:45 +0100 |
> 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. ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] parsing parens in the par, G. Ken Holman | Thread | Re: [xsl] parsing parens in the par, Liam Quin |
Re: [xsl] parsing parens in the par, G. Ken Holman | Date | Re: [xsl] parsing parens in the par, Liam Quin |
Month |