[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Regular expression functions (Was: Re: comments on
Jeni - 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. David _____________________________________________________________________ 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|