Javascript examples for RegExp:Quantifier
The n+ quantifier matches any string that contains at least one n.
The following code shows how to Do a global search for at least one "o":
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//w ww . j a v a 2s. c om var str = "Hellooo World! Hello W3Schools!"; var patt1 = /o+/g; var result = str.match(patt1); document.getElementById("demo").innerHTML = result; } </script> </body> </html>