JavaScript multiline Property
Example
let text = "Visit W3Schools!";
let pattern = /W3S/gi; // "g" and "i" is set, "m" is not.
let result = pattern.multiline;
Try it Yourself »
Description
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.
Browser Support
multiline
is an ECMAScript1 (JavaScriopt 1997) feature.
It is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
RegExpObject.multiline
Return Value
Type | Description |
---|---|
Boolean | Returns true if the "m" modifier is set, false otherwise |