Regular expression syntax
Word boundary
Checks a boundary between word and nonword positions; uses regex word characters, not full natural-language segmentation.
Formal Syntax & Structure
javascript syntaxjavascript
\bWorking Example
Example Snippetjavascript
console.log(/\bcat\b/.test("cat nap"));