CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
URL read problem.

 



iceman
Deleted

Aug 29, 2000, 1:45 AM

Post #1 of 2 (2275 views)
URL read problem. Can't Post

Hi,
I simply can't get this expression to work. It's suppose to take the hexdecimal values (eg: %3A) sent from a HTML <form> and translate it back into ASCII.

$Value =~ s/%(\dA-Fa-f)/pack("C", hex($1))/eg;

Any help would be greatly appreciated.

Thanks in advance, Matt.


Kanji
User / Moderator

Aug 29, 2000, 1:53 AM

Post #2 of 2 (2275 views)
Re: URL read problem. [In reply to] Can't Post

You missed out the brackets to denote \dA-Fa-f should be interpreted as a character class (your code is trying to match a number followed by the string "A-Fa-f").

You probably wanted ...

s/%([\da-fA-F]{2})/pack("c",hex($1))/eg;

... instead.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives