modify regexes and input to use binary encoding, plus spec