1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-09-25 17:51:29 +00:00
parent ba2b829a0f
commit 9448424dba
5 changed files with 54 additions and 16 deletions

View file

@ -5,7 +5,9 @@ class String
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
def _regex_quote(str)
a = str.gsub(/\W/){|s| if s == "-" then s else "\\\\#{s}" end}
str.gsub(/\W/){|s|
if s == "-" then s elsif s == "\\" then "\\\\" else "\\\\#{s}" end
}
end
private :_regex_quote