[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] lookaheads in XSLT2 regexes

Subject: Re: [xsl] lookaheads in XSLT2 regexes
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Fri, 26 Feb 2010 18:29:47 +0100

James Cummings wrote:

Basically, inside an xsl:analyze-string I am passing a variable as the
contents of @regex.  In the list of regexes for that get passed to
this I'd like to be able to match, say, foo when not followed by an
't' and also match foo when followed by a 't' but not include that 't'
in the string being matched.

I'm terrible at regular expressions, but I believe in various regex
processors in some languages you are able to do things like
foo(?=t) and foo(?!t) to do this and still have the 't' processed
separately. Similarly with lookbehinds.  Does anything like that exist
in XSLT2 regex?

No, as far as I know and as far as http://www.w3.org/TR/xquery-operators/#regex-syntax describes those constructs do not exist in the regular expression language that XPath 2.0 and XSLT 2.0 use.


	Martin Honnen

Current Thread