Latest web development tutorials

JavaScript multiline property

RegExp Object Reference JavaScript RegExp Object

Definition and Usage

multiline property is used to return to the regular expression whether flag m.

If the m flag is set, this property is true, otherwise false.

grammar

RegExpObject.multiline


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support multiline property.


Examples

Examples

Find whether the flag m:

<script>

var str="Visit W3Cschool!";
var patt1=/W3C/gi;

if(patt1.multiline)
{
document.write("m modifier is set!");
}
else
{
document.write("m modifier is not set!");
}

</script>

Examples of the above output:

m modifier is not set!

try it"


RegExp Object Reference JavaScript RegExp Object