I'm creating a system to allow some users update parts of their site. 1. I'm using CFFILE action="read" to pull the file. 2. Then I'm pulling out sections within divs to be replaced. 3. These sections are placed in forms allowing users to update them and then using CFFILE to update the file by writing over the existing file.
OK, so far so good. The problem is in the regex. It works -- but not as it should?!? <cfset title = REreplace(readFile,'^.*<div id="newsletterBody">([EMAIL PROTECTED])</div>.*$','\1','all')> I read the regex above as Scan through string readFile 1. start at the begining ^.* 2. find <div id="newsletterBody">(.*)</div> 3. group 1 is everything between the <div>s DIDN'T WORK !!! OK, let's put a stop. Search for everything except for a > 4. ([^>]*) worked fine except for the fact that there are <P>s and <BR>s. Alrightly then use a @ as the stop 5. ([EMAIL PROTECTED])I put a @ between the <div>s. That didn't work!!! 6. After much fumbling I put the @ after the <div>s. Go figure that worked. But isn't group 1 ([EMAIL PROTECTED]) between the <div>s. Why would the @ work outside the <div>s? I have <div id="newsletterBody">lorem ipsum whatever<P> lorem ipsum more stuff<P></div><!-- @ --> Gilbert Midonnet ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4