[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: lookaheads in XSLT2 regexes

Subject: RE: lookaheads in XSLT2 regexes
From: Liam R E Quin <liam@xxxxxx>
Date: Thu, 04 Mar 2010 00:59:44 -0500
RE:  lookaheads in XSLT2 regexes
On Wed, 2010-03-03 at 21:27 +0000, Michael Kay wrote:
> > On the subject of \b I'll note we do have \W and \w 
> 
> So we do, I overlooked that. And we define it a little differently from
> Perl:
> 
> [#x0000-#x10FFFF]-[\p{P}\p{Z}\p{C}] 
> 
> So for example "+" is regarded as part of a word, while "-" isn't. Which
> strikes me as totally useless, to be honest.

I agree.

We could fix that for XPath 2.1 I think.  I'm not sure what the most
useful fix would be, I admit.

The Perl definition of "alphanumeric" plus "_" would probably work for
\w, if one took alphnumeric to mean Letters|Numbers, \p{L}|\p{N},
and is coincidentally closer to what you get in Perl if you do
    use locale;
and your locale is (say) en_UK.UTF8, as it's then the same as
the POSIX fragment [[:alpha:][:digit:]_]

There are lots of things that could be added to regular expressions;
but \b is hard to emulate, useful, and also we seem to have a rather
odd \w.  If \w is there, I think \b was omitted by mistake.  Or that
\w was included by mistake!
 
Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.