From: Robert Klemme Date: 2006-06-03T16:39:02+09:00 Subject: Re: Pattern Matching Question 2006/6/2, mitchell : > 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 guess you are trying to extract this string from a larger one. Try this: s.scan %r<\{((?:\\.|[^\\}])*)\}> do puts $1.strip.gsub(/\\(.)/, '\\1') end or - without stripping the white space: s.scan %r<\{((?:\\.|[^\\}])*)\}> do puts $1.gsub(/\\(.)/, '\\1') end HTH robert -- Have a look: http://www.flickr.com/photos/fussel-foto/