Latest

recent

JavaScript RegExp \D Modifier

Definition and Usage

When the \D modifier is set the regular expression finds any non digit character.

Syntax

/\D/


Example

In the following code we will do a global search for any character that is not a digit:

var str = "Give 100%";
var patt1 = /\D/g;

The marked text below shows where the RegExp gets a match:

Give 100%
JavaScript RegExp \D Modifier Reviewed by 1000sourcecodes on 21:52 Rating: 5
Powered by Blogger.