Added compiled regexes, more comments