From: Grant Hollingworth Date: 2006-10-27T01:55:20+09:00 Subject: Re: Question about strings * William Carpin [2006-10-26 10:25]: >I also tried using the gsub function, with "\\\'" passed in as the >second parameter, and it just started outputting some sort sort of >goofiness with characters replaced by sub-elements of the string for >which I was calling the function on and the like. Your replacement string ends up as \', which is the equivalent of Perl's $' (the substring from the match to the end). The best solution I could find was to match the space before the quotation mark. >> "I am Will's string!".gsub(/(?=')/,'\\') => "I am Will\\'s string!"