Actually, that's not all that easy. Regex is great for tokenizing, but not parsing. There are ways to determine whether or not you are "inside" quotes, but in my experience, looping usually gives you the best results -- especially when the text is not precicely what you expect. For example, quotes doubled to escape them, unclosed quotes, etc.
--Ben Doom Josh Nathanson wrote: > Hey all, > > Got a regex challenge...I was able to solve it using an REFind and then > REReplace, but I'm wondering if anyone can come with a "one-shot" way to > replace without looping. > > I need to remove any carriage returns within a quoted string, but not touch > them if they are outside quotes. So: > > "the quick brown fox \r\n jumps over the \r\n lazy dog" <-- remove the > \r\n's > > My name is mud \r\n <-- leave this one alone > > I'm sure this is probably easy for the regex gurus... > > -- Josh > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293227 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4