spiderbo has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
Searched high and low for this one without any joy, so came here for some advice.
I have a string where I would like to replace all the hex values to 'normal' chars.
This is my string: my $title = "C%3A%5CMy%20Documents%5CMy%20Pictures%5Cbodmin1.jpg"
I would like it to read: C:\My Documents\My Pictures\bodmin1.jpg
I tried this, but it didn't work: my $testtitle =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("c",hex($title))/ge;
Any suggestions or ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: More regex's with hex's
by broquaint (Abbot) on Apr 22, 2003 at 11:11 UTC | |
|
Re: More regex's with hex's
by Abigail-II (Bishop) on Apr 22, 2003 at 11:11 UTC | |
|
Re: More regex's with hex's
by davorg (Chancellor) on Apr 22, 2003 at 11:16 UTC | |
by spiderbo (Sexton) on Apr 24, 2003 at 15:49 UTC |