View Single Post

Re: How to decode JavaScript's encodeURIComponent in Perl.
  #5 (permalink)  
Old 01-23-2007, 08:13 AM
Dr.Ruud
 
Posts: n/a
Default Re: How to decode JavaScript's encodeURIComponent in Perl.

John Bokma schreef:
> Cloink:


>> $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;

>
> s/%([0-9a-f]{2}/ chr hex $1 /egi;


^closing bracket missing

s/%([:xdigit:]{2})/ chr hex $1 /eg;

s/%((?ix) [0-9a-f] {2} )/ chr hex $1 /eg;


> Probably better to use URI::Escape.


Yep.

--
Affijn, Ruud

"Gewoon is een tijger."
Reply With Quote