in reply to Re^2: Regex String
in thread Regex String
... split it to bytes.
If this means you want to end up with an array (or string) of byte values for each pair of hex digits, consider pack:
c:\@Work\Perl>perl -wMstrict -MData::Dump -le "my $s = '00000FFEDFF6'; print qq{'$s'}; ;; my @bytes = split '', pack 'H*', $s; dd \@bytes; " '00000FFEDFF6' ["\0", "\0", "\17", "\xFE", "\xDF", "\xF6"]
Update: Another validation test to make sure you have an even number of hex digits in the source string might also be a good idea.
|
|---|