more regexes and a bug fix