-2

I have having trouble understanding what exactly these regular expressions below mean. Could someone provide an example?

^cat$ 
^$ 
^ 
R Sahu
  • 204,454
  • 14
  • 159
  • 270
Jow
  • 1

1 Answers1

2

^ matches the start of a line.
$ matches the end of a line.

^cat$ matches all lines whose contents are exactly cat.
^$ matches all empty lines.
^ matches the start of all lines.

R Sahu
  • 204,454
  • 14
  • 159
  • 270