xsl-list
[Top] [All Lists]

Re: [xsl] lookaheads in XSLT2 regexes

2010-02-26 13:58:28
That's great news! With the '!' flag, the much-missed '\b' (word boundary) works. Using it seems safe, at least compared to groups or lookaheads. If you don't discontinue the '!' flag, it will be as stable as Java regexes.

Gerrit

On 26.02.2010 19:21, Michael Kay wrote:
If you're completely stuck, there's an undocumented, largely untested, and
completely non-conformant option in Saxon - if the flags attribute starts
with "!", you can use full Java regular expression syntax in the regex
attribute. This may not work perfectly, for example it may disrupt the
counting of captured groups in regex-group().

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay

-----Original Message-----
From: james(_at_)blushingbunny(_dot_)net
[mailto:james(_at_)blushingbunny(_dot_)net] On Behalf Of James Cummings
Sent: 26 February 2010 18:07
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] lookaheads in XSLT2 regexes

On Fri, Feb 26, 2010 at 17:29, Martin Honnen
<Martin(_dot_)Honnen(_at_)gmx(_dot_)de>  wrote:
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.

I thought that was what you were going to say (and I should
have just looked at the spec before posting, mea culpa). I
can't think of any other way to do this with the
analyze-string recursive replacing with xsl:sequence...and
I'm loathe to change that much since it is working fine!  I
suppose one answer is to transform the input so it has
better/more/different delimiters of some sort, but I'll have
to think that through.

Ah well,
-James

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



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


--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

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