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
In reply to Re: hex in regexp
by kcott
in thread hex in regexp
by shamanoff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |