$ cat bug.pl #!/usr/bin/perl use strict; use warnings; my $str = join("", map { chr } 0x13, 0x00, 0x00, 0x00, 0xf8, 0x90, 0xbc, 0xac, 0x3a, 0x26, 0x1c, 0x27, 0xb3, 0x22, 0x22, 0xb3, 0xf6, 0x60, 0x23, 0x2d, 0x77, 0xbf, 0xdb, 0xda, 0xd1, 0xad, 0x0a, 0x98, 0x1a, 0x38, 0xae, 0x76, 0xee, 0x77, 0x66, 0x35, 0x66, 0x00, 0x65, 0x00, 0x74, 0x00, 0x69, 0x00, 0x64, 0x00, 0x5f, 0x00, 0x69, 0x00, 0x73, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x5f, 0x00, 0x32, 0x00, 0x2e, 0x00, 0x74, 0x00, 0x67, 0x00, 0x72, 0x00, 0x00, 0x00, 0xff, 0xfe, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x31, 0x00, 0x37, 0x00, 0x0a, 0x00, 0x53, 0x00, 0x69, 0x00, 0x7a, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x20, 0x00, 0x34, 0x00 ); for my $c (split //, $str) { printf "%02x ", ord($c); } print "\n"; if ($str=~/^(.{36})(.*?)\0\0\0/) { print "Found it!\n"; } else { print "?where is it?\n"; } $ perl bug.pl 13 00 00 00 f8 90 bc ac 3a 26 1c 27 b3 22 22 b3 f6 60 23 2d 77 bf db da d1 ad 0a 98 1a 38 ae 76 ee 77 66 35 66 00 65 00 74 00 69 00 64 00 5f 00 69 00 73 00 6c 00 61 00 6e 00 64 00 5f 00 32 00 2e 00 74 00 67 00 72 00 00 00 ff fe 76 00 65 00 72 00 73 00 69 00 6f 00 6e 00 20 00 31 00 37 00 0a 00 53 00 69 00 7a 00 65 00 3a 00 20 00 34 00 ?where is it?