added DOTALL to binary regex to fix bug