On Sat, Jan 11, 2003 at 09:41:37PM -0500, [EMAIL PROTECTED] wrote:
> In a message dated 1/11/2003 8:55:37 PM Eastern Standard Time, 
> [EMAIL PROTECTED] writes:
> > When processing the form the date in this format 3/1/2003 is converted to
> > 3%2F1%2F2003.
> > 
> > Can someone give me a regex to convert it back again please. Im only new to
> > perl and am struggling with regex's
> 
> $value = "3%2F1%2F2003";  
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; 

I'd recommend using CGI.pm instead of hand-rolling it:

my $q = new CGI;
my $value = $q->param('date');  # or whatever the field is called

It can do a tons of other CGI-related things too -- perldoc CGI

-- 
Michael
[EMAIL PROTECTED]
http://www.jedimike.net/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to