Javascript examples for RegExp:Bracket
Do a global, case-insensitive, multiline search for "is" at the beginning of each line in a string:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from ww w . ja v a 2 s .c o m*/ var str = "\nIs th\nis h\nis?"; var patt1 = /^is/gmi; var result = str.match(patt1); document.getElementById("demo").innerHTML = result; } </script> </body> </html>