mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ba2b829a0f
commit
9448424dba
5 changed files with 54 additions and 16 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue