I posted questions to the talk section yesterday and you guys have been great
help.
I'm trying to replace all instance of image tags e.g <img alt="" height="158"
src="/uploads/Image/BlissStarWars_15.jpg" width="210"/> with the following tag
<ContentItem Href="BlissStarWars_15.jpg" Duid="hardcoded">
<Comment>hardcoded</Comment>
<MediaType FormalName=""/>
<Format FormalName=""/>
</ContentItem>
At the moment the regular expression below fills in the Href attribute in the
ContentItem tag.
<cfset content = rereplace(dataContent,
"<img([^src]*)(src=['|""])([/*[[:alnum:]]*/]*)([^""]*)[^>]*>", "<contentItem
Href=""\4""><Comment>hardcoded</Comment> <MediaTypeFormalName=""hardcoded""/>
<Format FormalName=""the Format type .ext type is supposed to be in
here""/><contentitem>", "all")>
What I want to also achieve is get the extension "jpg" from filename and stick
it in the Format tag inside the attribute FormalName is this at all possible?
Many thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 beta â Build next generation applications today.
Free beta download on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta
Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1042
Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21