1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/jcode.rb (_regexp_quote): fix quote handling.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2001-09-05 08:45:47 +00:00
parent 2e2786ccab
commit 2a67d0b9f9
2 changed files with 5 additions and 3 deletions

View file

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