Regex Anchors

Position matching

Line Anchors

^ # start of line/string
$ # end of line/string

Word Boundaries

\b # word boundary
\B # not a word boundary

Examples

^abc # line starts with abc
abc$ # line ends with abc
^abc$ # entire line is abc
\bword\b # matches word as whole word
\Bcat\B # matches cat not at word boundary