Web/JavaScript/Reference/Global objects/RegExp/multiline

From Get docs


The multiline property indicates whether or not the "m" flag is used with the regular expression. multiline is a read-only property of an individual regular expression instance.


Property attributes of RegExp.prototype.multiline
Writable no
Enumerable no
Configurable yes


Description

The value of multiline is a Boolean and is true if the "m" flag was used; otherwise, false. The "m" flag indicates that a multiline input string should be treated as multiple lines. For example, if "m" is used, "^" and "$" change from matching at only the start or end of the entire string to the start or end of any line within the string.

You cannot change this property directly.

Examples

Using multiline

var regex = new RegExp('foo', 'm');

console.log(regex.multiline); // true

Specifications

Specification
ECMAScript (ECMA-262)The definition of 'RegExp.prototype.multiline' in that specification.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile Server
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet Node.js
multiline Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

Full support 5.5

Opera

Full support 5

Safari

Full support 1

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

nodejs

Full support 0.1.100

Prototype accessor property (ES2015) Chrome

Full support 48

Edge

Full support 12

Firefox

Full support 38

IE

Full support 5.5

Opera

Full support 35

Safari

Full support 1.3

WebView Android

Full support 48

Chrome Android

Full support 48

Firefox Android

Full support 38

Opera Android

Full support 35

Safari iOS

Full support 1

Samsung Internet Android

Full support 5.0

nodejs

Full support 6.0.0

Legend

Full support  
Full support


See also