[prev] [index] [next]

Anchors

We can insist that a pattern appears at the start or end of a line
  • the start of the line is denoted by ^ (uparrow)
  • the end of the line is denoted by $ (dollar)
E.g. ^[abc] matches either a or b or c at the start of a line.

E.g. cat$ matches the string cat but only at the end of a line.