Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

RegExp \D metacharacter

JavaScript RegExp \D metacharacter

RegExp Object Reference JavaScript RegExp Object


Definition and Usage

The \D metacharacter is used to find non-digit characters.

Syntax

new RegExp("\D")

Or a simpler way:

/\D/


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the \D metacharacter


Example

Example

Perform a global search for non-digit characters in the string:

var str="Give 100%!";

var patt1=/\D/g;

The text marked below shows where the expression found matches:

Give

100

%!

Try it »


RegExp Object Reference JavaScript RegExp Object