use \A and \z instead of ^ and $ in ruby regexes