naruse / ruby-lang.org wrote:
>   http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48244

--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -851,7 +851,7 @@ module URI
       v.encode!(Encoding::UTF_8) rescue nil
       v.delete!("\t\r\n")
       v.force_encoding(Encoding::ASCII_8BIT)
-      v.gsub!(/(?!%\h\h|[!$-&(-;=?-_a-~])./n){'%%%02X' % $&.ord}
+      v.gsub!(/(?!%\h\h|[!$-&(-;=?-Z_a-~])./n.freeze){'%%%02X'.freeze % $&.ord}
       v.force_encoding(Encoding::US_ASCII)
       @query = v
     end

freeze a literal regexp?  I'm not familiar with regexp code,
so I'm wondering if there is a good reason for this.  Thanks.

Btw, I hope the freeze for String#% can be removed soon: [Feature #10423]