JavaScript multiline property
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





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 »
JavaScript RegExp Object