I understand this is a comment, but please now that ^ and $ don't do what you'd expect in Ruby. You mean (hopefully) \A and \Z.