in reply to RegEx Confusion!
I'd much rather use substr() and unpack():($flag1, $bytecount, $mystery, $flag2) = $frame =~ m{ ^ ( [01]{8} ) ( [01]{16} ) ( [01]*? ) # that could be [01]* for all I care... ( [01]{8} ) $ }x;
No backtracking. Just simplicity.($flag1, $bytecount, $mystery) = unpack "A8 A16 A*", $frame; $flag2 = substr($mystery, -8, 8, '');
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|