Hi,

In message "[ruby-talk:15526] Perl's quotemeta in ruby"
    on 01/05/22, Matt Armstrong <matt / lickey.com> writes:

|1) Is this the best way to implement Perl's quotemeta in Ruby?

 Regexp::quote(s)

|2) Is there an equivalent to quotemeta already built in?

 see above answer.

|3) Ruby 1.4's CGI::escape is this:

|   Why not just this:
|
|  def CGI::escape(string)
|    string.gsub(/[^a-zA-Z0-9_.-]/n){ sprintf("%%%02X", $&.unpack("C")[0]) }
|  end

 probably historical reason.

							matz.