Javascript examples for RegExp:Modifier
The i modifier does a case-insensitive matching.
The following code shows how to Do a case-insensitive search for "book2s" in a string:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from ww w.ja va2 s . co m*/ var str = "The following code shows how to do java2s.com!"; var patt1 = /book2s/i; var res = patt1.ignoreCase; document.getElementById("demo").innerHTML = res; } </script> </body> </html>