Easy Tutorial
❮ Met Table Deletecaption Prop Meter Value ❯

JavaScript RegExp \b Metacharacter


Definition and Usage

The \b metacharacter matches word boundaries.

The \b metacharacter is commonly used to find matches at the beginning or end of words.

Syntax


Browser Support

All major browsers support the \b metacharacter.


Example

Perform a global search for "Run" at the beginning or end of words in a string:

var str="Visit Runooob"; 
var patt1=/\bRun/g;

The following marked text shows where the expression matches:

Visit tutorialpro

❮ Met Table Deletecaption Prop Meter Value ❯