in reply to hex in regexp
The standard way is to do this is like the following:
$ perl -Mstrict -Mwarnings -E ' > my $x = q{X-X!X?X}; > $x =~ s/([[:^upper:]])/unpack q{H2}, $1/eg; > say $x; > ' X2dX21X3fX
Note: I used upper instead of ascii for my example code.
There may be modules that also supply this functionality. If there are, I'm sure other monks will provide details.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hex in regexp
by shamanoff (Initiate) on May 22, 2012 at 05:04 UTC | |
by kcott (Archbishop) on May 22, 2012 at 12:39 UTC | |
by shamanoff (Initiate) on May 22, 2012 at 21:09 UTC | |
by shamanoff (Initiate) on May 22, 2012 at 21:23 UTC |