Regular Expression Anchors

Anchors


Anchors tie an expression to something else. Such as the begining or end of a line

Metacharacter Description
^ Anchors to the begining of a line. A caret by itself indicates a line begining which all lines have.
$ Dollar anchors to the end of a line.

Examples:

^Start will display all lines that begin with S followed by t followed by a followed by r followed by t regardless of what else is on the line. For example: will all be displayed with ^Start

  • Start today
  • Start living
  • Start the car

end$ will display all lines that have e followed by n followed by d just before the end of the line. Regardless what else is on the line. will all be displayed with end$

  • This is the end
  • We are near the end
  • Rear end
  • Bookend

^line$ will display all lines that begin with l followed by i followed by n followed by e followed by an end of line. For example this regex ^line$ will not display it will only display the single word line on a line by itself.

  • New line
  • Biline
  • This is the end of the line
  • Don not cross the line

CREATED 2016-04-17 17:00:22.0

00-24-C6

UPDATED 2016-04-17 17:55:21.0

Knowledge

L
I
N
K
S

DBID: db.wam

Page Server: Ithica

©2012 Leistware Data Systems

      Hello anonymous