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

Re: Regular expression functions (Was: Re: comments on

Subject: Re: Regular expression functions (Was: Re: comments on December F&O draft)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 10 Jan 2002 11:23:47 GMT
sed functions matching whitespace

  - introducing a syntax for naming the subexpressions rather than
    numbering them

this works surprisingly well in omnimark, although I thought it odd when
I first saw it. It also allows you to grab nested strings rather than
having to reconcatenate #1 #2 etc for example (in a mixture of omnimark
and sed/perl syntax)

given ([a-z])([a-z0-9]*) matching an identifier starting with a letter
and going on with letters and numbers you can given numered
subexpressions get hold of $1 and $2 to get the two parts but if you
also need the full identifier you have to concat them back together
again. but omnimark allows something more like
 ( ([a-z]) => first-letter ([a-z0-9]*) => following-letters-digits ) => the-whole-thing

then you can use $first-letter, $following-letters-digits and $the-whole-thing
in the code that is triggered by the match. 
(In Omnimark regexps white space is always ignored, you have to use a
special term to match white space, which allows these variable binding
clauses to be freely inserted anywhere inside the regexp, more or less)

> - I don't think that, at least in XSLT 2.0, this should necessarily be
> introduced because it's just a convenience (that leads to lots of
> other inconveniences!) rather than essential functionality.

agreed, although one nice effect is that it allows you to keep variable
names being qnames.


This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.