mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* regex.c (re_compile_pattern): fix previous change.
* instruby.rb, ext/extmk.rb, ext/tk/lib/tk.rb, lib/benchmark.rb, lib/cgi.rb, lib/debug.rb, lib/getoptlong.rb, lib/jcode.rb, lib/optparse.rb, lib/time.rb, lib/date/format.rb, lib/irb/ruby-lex.rb: escape `[', `]', `-' in chracter class in regexp to avoid warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
108cf940d8
commit
58ef7c2088
14 changed files with 56 additions and 46 deletions
|
|
@ -9,7 +9,7 @@ class String
|
|||
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
|
||||
|
||||
def _regex_quote(str)
|
||||
str.gsub(/(\\[][\-\\])|\\(.)|([][\\])/) do
|
||||
str.gsub(/(\\[\]\[\-\\])|\\(.)|([\]\[\\])/) do
|
||||
$1 || $2 || '\\' + $3
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue