fixed input processing regexes in browser. regexes hurt my feelings.