REReplace(str, '(<img\s[^>]*src=")image1\.jpg("[^>]*>)', "\1image2.jpg\2", "all")
Pascal > -----Original Message----- > From: Howie Hamlin [mailto:[EMAIL PROTECTED] > Sent: 27 April 2005 00:52 > To: CF-Talk > Subject: RegEx to manipulate html tags > > Does anyone know of a regex that I can use to replace parameters in the > tags of an html page? For example, I would want to replace the SRC > parameter of an <IMG> tag but the SRC parameter is not located in the same > postition of the <IMG> tag each time. So, as an example: > > <img src="image1.jpg"> > > <img height="100" width="100" src="image1.jpg"> > > should both be converted to: > > <img src="image2.jpg"> > > <img height="100" width="100" src="image2.jpg"> > > If the SRC parameter were always located after the IMG tag start (as in > the first example) then I could use a simple findnocase but that's not the > case. > > Thanks, > > -- > Howie Hamlin - inFusion Project Manager > On-Line Data Solutions, Inc. - www.CoolFusion.com > inFusion Mail Server (iMS) - The Award-winning, Intelligent Mail Server > PrismAV - Virus scanning for ColdFusion and BlueDragon applications > Find out how iMS Stacks up to the competition: > http://www.coolfusion.com/imssecomparison.cfm > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ > ++++++++++++++++++++++ > iMS-Lite - the completely free mail server solution for applications and > application servers > http://www.coolfusion.com/iMSLite > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ > ++++++++++++++++++++++ > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204633 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54