Easy Tutorial
❮ Prop Video Ended Jsref Return ❯

JavaScript RegExp \W Metacharacter


Definition and Usage

The \W metacharacter is used to find non-word characters.

Word characters include: a-z, A-Z, 0-9, and underscores.

Syntax


Browser Support

All major browsers support the \W metacharacter.


Example

Perform a global search for non-word characters in a string:

The text below marked shows where the expression matches: %!


❮ Prop Video Ended Jsref Return ❯