From: Peter Bailey Date: 2006-05-16T21:56:34+09:00 Subject: Problem with my gsub! I can't get a gsub! to work when I use a counter variable in my replacement. content.gsub!(/^%%Page:.*([0-9]{1,5})$/, "%%Page: $1") I literally get "Page: $1" in my output. Why? How do I indicate that I want the number, whatever it was, from the search? I've tried #{$1}, but that didn't work either. RUBY does use $1 for its counters, doesn't it? I've tried \1, but, that gives me even worse results. Thanks a lot. -- Posted via http://www.ruby-forum.com/.