[plt-scheme] pregexp questions

From: MJ Ray (markj at cloaked.freeserve.co.uk)
Date: Fri Jul 5 19:44:25 EDT 2002

Looks like this never appeared on-list.  Resend.

Hi,

I find myself wanting to do something similar to what the Perl regexp /e
flag gives, ie replace a part of a string with a function evaluated with the
matching string.  I'm probably not explaining this clearly: I'm trying to
replace %xx where xx are hex digits with the character equivalent to that
hex number.

Am I wrong to be looking at pregexp-replace, or am I missing some better way
to do this?  cgi-unit.ss does it with a let loop, which surprised me.  Is
that the most efficient and elegant way?

(FYI - I was trying to decode PATH_INFO, which I thought may be URL-encoded. 
It turns out it isn't, but the solution to similar problems still interests
me, as I've seen it before...)

Thanks,

MJR




Posted on the users mailing list.