Javascript examples for RegExp:Metacharacter
The \D metacharacter matches a non-digit character.
The following code shows how to Do a global search for non-digit characters:
<!DOCTYPE html> <html> <body> <p id="demo"></p> <button onclick="myFunction()">Test</button> <script> function myFunction()//from ww w .ja v a 2 s.c o m { var str = "this is a 100%!"; var patt1 = /\D/g; var result = str.match(patt1); document.getElementById("demo").innerHTML=result; } </script> </body> </html>