diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-09-05 08:45:47 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-09-05 08:45:47 +0000 |
commit | 2a67d0b9f93269a7234c017879cd0b3654baba0c (patch) | |
tree | ffef37cde88e885ebd28cc44d058bf234be7170f | |
parent | 2e2786ccab636dd82de640bd771f2cc9fc20ab31 (diff) | |
download | ruby-2a67d0b9f93269a7234c017879cd0b3654baba0c.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/jcode.rb | 4 |
2 files changed, 5 insertions, 3 deletions
@@ -1,3 +1,7 @@ +Wed Sep 5 17:41:11 2001 WATANABE Hirofumi <eban@ruby-lang.org> + + * lib/jcode.rb (_regexp_quote): fix quote handling. + Tue Sep 4 01:03:18 2001 Yukihiro Matsumoto <matz@ruby-lang.org> * re.c (Init_Regexp): to_s to be alias to inspect. diff --git a/lib/jcode.rb b/lib/jcode.rb index 7175c1b4b6..eda66cac10 100644 --- a/lib/jcode.rb +++ b/lib/jcode.rb @@ -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 |