Update regexes to use \A and \z anchors for start and end of string,
instead of $ and ^.