Sweet nice job! Works great. I only needed to replace the tags one at a time though (just [b] not [b][/b]) the way I have my array set up for the available tags
Bbtag[1] = "[b]|<b>"; Bbtag[2] = "[/b]|</b>"; Bbtag[3] = "[i]|<i>"; Bbtag[4] = "[/i]|</i>"; Etc... Etc... Slight change and it works great. str = rereplace(str, "(\[b\])(?!((?!\[code\]).)*?\[/code\])", "<b>", "ALL"); I'll probably change my array and use your original as long as it doesn�t give me a fit on tags without closing tags smileys, [hr] etc... Thanks again. Nice job! -----Original Message----- From: Umer Farooq [mailto:[EMAIL PROTECTED] Sent: Saturday, January 15, 2005 9:41 PM To: CF-Talk Subject: Re: regex help Err.. the pre points to <pre> it should be [pre].. fixed one below.. (\[b\]([Aa-zZ0-9\s]*)\[/b\])(?!((?!\[pre\]).)*?\[/pre\]) Umer Farooq wrote: > The following regex should do the trick.. > > <cfset changed = rereplace(temp, > "(\[b\]([Aa-zZ0-9\s]*)\[\/b\])(?!((?!<pre>).)*?<\/pre>)", "<b>\2</b>", > "ALL")> > > note the backrefrence "\2" is to ([Aa-zZ0-9\s]*).. do not use the "dot" > notation in there. > > -- > Regards > > Ewok wrote: > >>This is a tough one... >> >>It's an old bbml parser I wrote a while back and im trying to modify it a >>little. >> >>I want to search through the string and replace all instances of [b] with >><b> UNLESS it falls between [pre] and [/pre] >> >>I just can't seem to get it right. >> >>Replace [b] with <b> except when it starts with [code]* and ends with >>*[/code] >> >>Even that sentence was hard to write at 4 in the morning ZZzzzz >> >> >> >> > > -- Umer Farooq Octadyne Systems +1 (519) 489-1119 voice ***NEW AS OF 01/05*** +1 (519) 635-2795 mobile +1 (208) 275-3824 fax LOOKING FOR A USED CAR IN IOWA VISIT: http://www.IowaMotors.com WARNING: ------------------------------- The information contained in this document and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information is strictly prohibited. If you have received this document by mistake, please notify the sender immediately and destroy this document and attachments without making any copy of any kind. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190612 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

