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

RE: Using parameter as regex in matches() function

Subject: RE: Using parameter as regex in matches() function
From: "Houghton,Andrew" <houghtoa@xxxxxxxx>
Date: Thu, 29 May 2008 18:23:14 -0400
RE:  Using parameter as regex in matches() function
> From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
> Sent: Thursday, May 29, 2008 6:10 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Using parameter as regex in matches() function
>
> You want
>
> matches(., concat('^', $criteria_name, '$'))

Assuming that $criteria_name doesn't include any regular expression meta
characters.  Unfortunately, XSL doesn't have the Perl equivalent of
quotemeta() built into the library.  Certainly you can write a replace() to do
it and create a quotemeta() function to wrap it, but it would have been nice
to say:

matches(.,concat('^',quotemeta($criteria_name),'$'))


Andy.

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.