Javascript examples for RegExp:Property
The ignoreCase property sets whether or not the "i" modifier is set.
This property returns true if the "i" modifier is set, otherwise it returns false.
Type | Description |
---|---|
Boolean | Returns true if the "i" modifier is set, false otherwise |
The following code shows how to Check whether or not the "i" modifier is set:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w .j a v a2 s.c om var str = "The following code shows how to !"; var patt1 = /code/i; var res = patt1.ignoreCase; document.getElementById("demo").innerHTML = res; } </script> </body> </html>