From: Jeff Schwab Date: 2009-02-21T03:59:46+09:00 Subject: Re: Un-escaping hexadecimal code Igor Pirnovar wrote: > I単aki Baz Castillo wrote: >> El Viernes, 20 de Febrero de 2009, Jeff Schwab escribi坦: >>> puts s >>> >>> You might also consider supporting escaped % literals. >> Also, it should consider not just number but A-F > > s = "%4Flice" > s.gsub! /%([\da-fA-F][\da-fA-F])/ { $1.to_i(16).chr } > puts s SyntaxError: compile error (irb):2: syntax error, unexpected '{', expecting $end s.gsub! /%([\da-fA-F][\da-fA-F])/ { $1.to_i(16).chr } ^