Are you using CFMX? If so you can specify minimal matching, which I think is probably the only way you can do this using a single regex. I think you replace .* with .*?
-----Original Message----- From: Ewok [mailto:[EMAIL PROTECTED] Sent: Monday, 17 January 2005 10:01 a.m. To: CF-Talk Subject: RE: regex help (Almost) The regex works for most cases... but it's not stopping at the next ending tag... For example, the quote replac regex... I have [quote]heres a quote[/quote] Here's some text [quote]here's another quote[/quote] The expression replaces quote tags with blockquote tags unless it false between [code][/code] tags (which it doesntin this case) The result is <blockquote>heres a quote[/quote] Heres some text [quote]here's another quote</blockquote> Which of course should be <blockquote>Heres a quote</blockquote> Heres some text <blockquote>here's another quote</blockquote> This is the regex that's causing this... str = rereplace(str, "(\[quote\](.*)\[/quote\])(?!((?!\[code\]).)*?\[/code\])", "<blockquote>\2</blockquote>", "ALL"); How can I change it to stop at the first [/quote] tag? -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.12 - Release Date: 1/14/2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:190634 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54