in reply to RegEx on Binary data

It seems like you want unpack, or maybe an unpack helper library like Parse::Binary.