How to convent regex with pack and hex from Perl to Python

Posted by Brent McConnell on Stack Overflow See other posts from Stack Overflow or by Brent McConnell
Published on 2010-06-06T23:08:16Z Indexed on 2010/06/06 23:12 UTC
Read the original article Hit count: 330

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about python

Related posts about perl