title: Difference between \A \z and ^ $ in Ruby regular expressions
body: <p>In the documentation I read:</p>
  
  <blockquote>
    <p>Use \A and \z to match the start and end of the string, ^ and $ match the start/end of a line.</p>
  </blockquote>
  
  <p>I am going to apply a regular expression to check username (or e-mail is the same) submitted by user. Which expression should I use with <code>validates_format_of</code> in model? I can't understand the difference: I've always used ^ and $ ...</p>