Javascript examples for RegExp:Bracket
Do a global search for numbers that are NOT 5 to 8 in a string:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*w w w. ja v a 2 s .c o m*/ var str = "123456789"; var patt1 = /[^5-8]/g; var result = str.match(patt1); document.getElementById("demo").innerHTML = result; } </script> </body> </html>