http://www.perlmonks.org?node_id=1054417


in reply to Regular expression to match binary data amoun text data

I'm not sure if this is relevant, but using file rather than head would give you a more sensible message to match against.