From: Jason Sweat Date: 2006-06-02T12:00:04+09:00 Subject: Re: Pattern Matching Question On 6/1/06, mitchell wrote: > If I had the text "{ hello \\} there }", what regex could I use to get > "hello } there" back? I'm really stumped on this one. with the new regex engine in ruby 1.9 you can use a lookbehind assertion: $ ruby19 -e 'p /\{(((?<=\\)\}|[^}])*)\}/.match("{ hello \\} there }")[1].strip.gsub("\\}","}")' "hello } there" -- Regards, Jason http://blog.casey-sweat.us/