Anchors

Function
RegExp equivalent
Explanation

lineStart

^

Assert position at the start of string, or start of line if multiline flag is set

not.lineStart not(lineStart)

(?!^)

Assert position not at the start of string/line

lineEnd

$

Assert position at the end of string, or end of line if multiline flag is set

not.lineEnd not(lineEnd)

(?!$)

Assert position not at the end of string/line

wordBoundary

\b

Assert position at a word boundary, between word and non-word characters

not.wordBoundary not(wordBoundary)

\B

Assert position not at a word boundary

Last updated