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

problem with replace()

Subject: problem with replace()
From: UlyLee <ulyleeka@xxxxxxxxx>
Date: Mon, 21 Nov 2005 04:49:52 -0800 (PST)
problem with replace
Hi!

I have this tiny problem regarding replace() and
matches(). i have a search string like "traits dunion"
and a source string like "illtraits dunions", if i run
replace("illtraits dunions", "traits dunion", "rep1")
the result woul be "illrep1s".

But i want my replace function to replace strings when
the character before the search string is a space, a
valid punctuation or a start of the string while the
character that appears after the serach string is a
space or a valid character.

ex:

illtraits dunions ---> should not be replaced
ill traits dunions ---> should not be replaced
ill traits dunion s ---> ill rep1 s
ill "traits dunion" s ---> ill "rep1" s
ill (traits dunion) s ---> ill (rep1) s
ill"traits dunion"s ---> should not be replaced

what regular expression can i use of replace or
matchcs so that i can match this type of pattern?

thanks,
UlyLee


		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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.