Regular expressions 3. Anchors

Anchors let you specify a very specific position within the search text.

^ Try to match the (following) regex at the beginning of a line.
    Example: "^ab" matches "ab" only at the beginning of a line and not, for example, in the line "cab".
$ Try to match the (following) regex at the end of a line.
< Try to match the regex at the start of a word.
The character class that defines a word can be found at the convenience escape sequences page.
> Try to match the regex at the end of a word.
\B Not a word boundary

© djmw, July 8, 2001