From: Dave Burt Date: 2006-06-02T11:45:02+09:00 Subject: Re: Pattern Matching Question 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. I'm not sure exactly what you're trying to do, but is this close? s = "{ hello \\} there }" a = s.scan(/ \{ (( \\ \} | [^}] )*) \} /x).map {|match| match[0].strip } a[0].gsub!("\\}", "}") p a[0] #=> "hello } there" Cheers, Dave