Subject:Can someone tell me if this is a disallowed regex construct? Author:David Corley Date:22 Nov 2006 05:37 PM Originally Posted: 22 Nov 2006 05:32 PM
I'm using oXygen 8.0 with Saxon 8.8b with the following line:
<xsl:analyze-string select="current-grouping-key()" regex="(?=[^\\]+$).+$" flags="i">
But saxon is throwing an error to oxygen saying:
"F Error in regular expression: net.sf.saxon.trans.DynamicError: Error at character 1 in regular expression "(?=[^\\]+$).+$": expected ())"
I'm assuming it's because my regex is using a disallowed construct, but can someone tell me what I'm doing wrong, so I can try and work around it?
Thanks in advance ;-D
Dave
PS. I should add that what I'm trying to do is take a string of the form
"xxxxx\nnnnnnnn\mmmmmmm\vvvvv.java"
and extract
"vvvvv"
from it
If you can offer a working regex solution that is xpath 2.0 compliant I would be extremely grateful, but an answer to the main question above is more important.
Subject:Can someone tell me if this is a disallowed regex construct? Author:David Corley Date:23 Nov 2006 07:37 AM
Hey Alberto,
I appreciate that fact, but because the question I was asking was regarding XSLT + Regex specifically (The problem has nothing to do with Oxygen, and I'm nearly certain it's not Saxon's fault either), I was hoping someone here might be able to help.
Sorry if I'm intruding.
Subject:Can someone tell me if this is a disallowed regex construct? Author:James Durning Date:23 Nov 2006 04:29 PM Originally Posted: 23 Nov 2006 04:23 PM
The ? is a reluctant qualifier, and you are qualifying nothing with it.
If you know your string matches, you could use tokenize instead. eg something like:
<xsl:value-of select="substring-before((tokenize(current-grouping-key(),'\'))[last()], '.'"/>