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

Re: Question on translate() function

Subject: Re: Question on translate() function
From: "Liam R. E. Quin liam@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Sep 2017 05:27:17 -0000
Re:  Question on translate() function
On Tue, 2017-09-26 at 01:45 +0000, Mailing Lists Mail
daktapaal@xxxxxxxxx wrote:
> I also have another question..
> I want to replace '[()''+\-*$=]' with the character + a #

replace( $str, '[()''+\-*$=]', '$0#')
?

$0 refers to the entire thing matched, or you can use capturing parens,

replace( $str, '([()''+\-*$=])', '$1#')

where $1 is the first thing inside (...), $2 would be the second (...)
group if there was one.

Regular expressions are incredibly powerful but be careful not to
overuse them or you'll never be able to understand what you wrote a
week later! :)

Liam

-- 
Liam Quin, W3C, http://www.w3.org/People/Quin/
Staff contact for Verifiable Claims WG, SVG WG, XQuery WG

Web slave for http://www.fromoldbooks.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.