I am a newcomer to Python and am converting a Perl script. What is the Python equivalent to...
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
Any help is greatly appreciated.
I am a newcomer to Python and am converting a Perl script. What is the Python equivalent to...
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
Any help is greatly appreciated.
You should likely just use urllib.unquote (python 2) / urllib.parse.unquote (python 3), since it looks like that's what the code you provided is trying to accomplish.