Ruby regular expressionsEdit

  • ^ matches beginning of line
  • $ matches end of line
  • \A matches beginning of string
  • \z matches end of string
  • \Z matches end of string, unless string ends with \n, in which case it matches just before the \n

Note: I've never needed to use \Z in a regular expression