Starting to rewrite code to use Regexes