JavaScript multilineProperty

RegExp 对象参考手册JavaScript RegExp Object

Definition and Usage

The multiline property is used to return whether the 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 EXAMPLE!"; var patt1=/RUN/gi; ​ if(patt1.multiline) { document.write("m mode is set!"); } else { document.write("m mode is not set!"); }

Try it yourself »


RegExp 对象参考手册JavaScript RegExp Object Other Extensions