RegExp multiline Property - Javascript RegExp

Javascript examples for RegExp:Property

Description

The multiline property returns true if the "m" modifier is set, otherwise it returns false.

Return Value

TypeDescription
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:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials