Easy Tutorial
❮ Jsref Abs Prop Style Paddingright ❯

JavaScript RegExp \B Metacharacter


Definition and Usage

The \B metacharacter matches non-word boundaries. The position before and after the match must be of the same type: both must be either word characters or non-word characters. The beginning and end of the string are considered non-word characters.

If no match is found, it returns null.

Syntax


Browser Support

All major browsers support the \B metacharacter.


Example

Perform a global search for "noob" not at the beginning or end of a word in the string:

The text marked below shows where the expression matches:

Visit tutorialpro

❮ Jsref Abs Prop Style Paddingright ❯