From: A LeDonne Date: 2006-05-25T01:43:18+09:00 Subject: Re: RegExp Problem On 5/24/06, John W. Long wrote: > That makes perfect sense. So how do I get it to do what I want? > > -- > John Long > http://wiseheartdesign.com > http://radiantcms.org Umm.... backwards? irb(main):001:0> re = /!(['"]).*?\1/ => /!(['"]).*?\1/ irb(main):002:0> fun = %{ "this looks like "fun"!" } => " \"this looks like \"fun\"!\" " irb(main):003:0> md = re.match fun.reverse => # irb(main):004:0> md[0].reverse => "\"fun\"!" This way, instead of trying to negate a character class, you're just doing a non-greedy match from the anchored exclamation point - quote mark combo to the first matching quote mark. -A