in reply to Regex to cange HTML %?? to char(0x??);
You should use either CGI (best solution) or URI::Escape.