Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript multiline property

JavaScript multiline property

RegExp Object Reference JavaScript RegExp Object


Definition and Usage

The multiline property returns whether a regular expression has the m flag.

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

Syntax

RegExpObject.multiline


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the multiline property.


Example

Example

Check whether the m flag is set:

var

str

=

"

Visit RUNOOB!

"

;

var

patt1

=/

RUN

/

gi

; ​

if

(

patt1

.

multiline

)

{

document

.

write

(

"

m mode is set!

"

)

;

}

else

{

document

.

write

(

"

m mode is not set!

"

)

;

}

Try it »


RegExp Object Reference JavaScript RegExp Object