in reply to Help with parsing a string

Well, you could:

use strict; use warnings; my $byte = qr/([0-9a-f]{2})/i; while (<DATA>) { my $line = join '', /\b$byte\b/g; next unless length $line; print "$line\n"; } __DATA__ 00 0A EF 85 BA 8F AA BC Wibble 00 0A EF 85 BA 8F AA BC

Prints:

000AEF85BA8FAABC 000AEF85BA8FAABC

Perl is environmentally friendly - it saves trees