Previous

Next


13. Metacharacters: ^ and $

  • Two very special metacharacter are caret and dollar:
      ^
      $
            
  • These character match the beginning and the end of a line respectively.
  • Hey, cool! Us vi users know that we can use caret to jump to the start of a line, and dollar to jump to the end of a line! Regexes are useful in editors as well!
  • Okay, so what's so special about that?
  • Well, so far, everything we've looked at has had to do with matching certain characters (or matching characters other than the one we've stated, in the case of negated character classes) - but these two are about matching certain positions in a line!

Previous

Next

Andrew Hill

For LinuxSA Meeting, 21 November 2000