<cfset html = REReplace(html, '^(.*?<img[^>]+header.jpg[^>]*>).*', '\1') />

I think that'll do it, but I didn't actually test.  That says
"starting at the beginning of the string, find everything until you
find the string "<img", followed by one or more characters excluding
">", followed by the string "header.jpg", followed by zero or more
characters excluding ">", and then replace the whole string with just
that part.

cheers,
barneyb

On Wed, Nov 18, 2009 at 1:43 PM, John Egbert
<[email protected]> wrote:
>
> Hey all!  I'm trying to capture all of the data up to a point in an HTML 
> document.  So for instance... there could be the <html><head>blabla bla 
> tags...and these could variate, but on every HTML doc there is a header 
> image.  <img src="header.jpg"> or whatever.  I need to know how I can write a 
> string command to capture/select everything previous and including the header 
> image (or not including the header image...I really need to know how to do 
> both.)
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328500
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