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