Selecting everything in a string up to a point....

2009-11-18 Thread John Egbert
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 htmlheadblabla 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

Re: Selecting everything in a string up to a point....

2009-11-18 Thread Barney Boisvert
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

RE: Selecting everything in a string up to a point....

2009-11-18 Thread Egbert, John
Hey Barney...thanks for the help! Just to simplify it, what if I just loaded whatever the header is into a string (so hypothetically, I would just want to replace everything up to a variable called headerstring)... would that just be cfset html = REReplace(html, headerstring, '\1') / Thanks