Once again, reengineer regexes.