Search w3schools.com:

SHARE THIS PAGE

JavaScript multiline Property

RegExp Object Reference JavaScript RegExp Object

Definition and Usage

The multiline property specifies whether or not the m modifier is set.

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

Syntax

RegExpObject.multiline


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The multiline property is supported in all major browsers.


Example

Example

Check whether or not the "m" modifier is set:

<script>

var str="Visit W3Schools!";
var patt1=/W3S/gi;

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

</script>

The output of the code above will be:

m modifier is not set!

Try it yourself »


RegExp Object Reference JavaScript RegExp Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]