From: Maciej Pilichowski Date: 2006-11-19T02:35:06+09:00 Subject: How to use regexp to replace character with backslash plus this character Hello, 1.8.5. I want to 'correct' filenames for unix shell so I want to preceed any let's say & with backslash. Here is code translated from my original script in Perl -- end of the function return filename.gsub(/([\;\!\&\%\$\' ])/,'\\\1') However it doesn't do anything good. If I put space in the middle \\ \1 the replacament is correctly recognized. But I don't want to use space in the middle. What's wrong here? have a nice day bye -- Maciej "MACiAS" Pilichowski http://bantu.fm.interia.pl/