Unless I misunderstand...

rereplace(dataContent, "<img.*?src=['|""|](.*?)['|""| |].*?>", "<contentItem
Href=""\1""><Comment>hardcoded</Comment> <MediaType
FormalName=""hardcoded""/> <Format FormalName=""hard coded""
/><contentitem>", "all")

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-----Original Message-----
From: Jide Aliu [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 14, 2007 10:44 AM
To: CF-Talk
Subject: Re: reReplaceNoCase() problem from a newbie, please help

Thanks Bobby for taking time out for the solution, that did the trick. It's
the start of my problem on the solution though how would you go about
reReplacing the same item with the tags below in a body of text/string. Is
it at all possible or should I be looking at something different from Regex?

<ContentItem Href="BlissStarWars_15.jpg" Duid="BlissStarWars_15.jpg">
<Comment>hardcoded</Comment> <MediaType FormalName="hardcoded"/> <Format
FormalName="hard coded"/>

So instead of isolating the the image name like I did below <cfset content =
REReplaceNoCase(dataContent,
"<img([^src]*)(src=['|""])([/*[[:alnum:]]*/]*)([^""]*)[^>]*>", "\4", "ALL")>
I want to take the image name and insert it into the <contentItem
Href="BlissStarWars_15.jpg"> with all the accompanying tags

</ContentItem>
> Try this one out.
> 
> rereplace(dataContent, "<img.*?src=['|""|](.*?)['|""| |].*?>", "\1",
> "all")
> 
...
> :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
> Bobby Hartsfield
> http://acoderslife.com
> 
> -----Original Message-----
> From: Jide Aliu [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 14, 2007 5:46 AM
> To: CF-Talk
> Subject: reReplaceNoCase() problem from a newbie, please help
> 
> I have a body of text, in the body of text I want to replace all image 
> tags with the value of the src attribute, so for example below
> 
> "This is the body it can be as long as 8,000 character but within the 
> body here is the image tag <img alt="" height="150"
> src="/uploads/allfiles/Image/BlissStarWars_15.jpg" width="200"/> and 
> here I go blah blah another image tag with a different value in the 
> src attribute <img alt="" height="150"
> src="/uploads/allfiles/Image/245.jpg" width="200"/>"
> 
> All I want to do is to replace the <img> tags with the src value which 
> is BlissStarWars_15.jpg for the first image tag encountered and 245.
> jpg for the second image tag. I have tried using the code below 
> without any joy at all.
> 
> <cfset content = reReplaceNoCase(dataContent,'<img.*?src=['|"](.
> *?)['|"].*?>','\1','ALL')>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281154
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to