From: Sarah Allen Date: 2009-05-11T09:18:21+09:00 Subject: Re: gsub pattern substitution and ${...} 7stud -- wrote: > If you need to use double quoted strings, then you need to literally > have \1 in your string, which requires the use of additional backslashes > to escape the \ in "\1". So try "\\1". With ruby if one backslash is > not enough, keep adding more backslashes until whatever you are trying > accomplish works! Eureka! >> s.gsub(/href=(['"])([^']*)/, "href=\\1#{URI.escape($2)}\\3") => "" Thanks so much for your help. Sarah -- Posted via http://www.ruby-forum.com/.