Fix parser for regexes (and improve speed)