By default, regexp matches anywhere in the text. You can use line and word anchors to specify additional restrictions regarding the position of matches. These restrictions are made possible by assigning special meaning to certain characters (metacharacters) and escape sequences.
^restricts the match to the start-of-line
This is a samplebut not
$restricts the match to the end-of-line
apple (5)but not
^$match empty line
\<patternrestricts the match to the start of a word
- word characters include alphabets, digits and underscore
pattern\>restricts the match to the end of a word
\<pattern\>restricts the match between start of a word and end of a word
End-of-line can be
\r (carriage return),
\n (newline) or
\r\n depending on your system and
See :h pattern-atoms for more details.