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 »
Definition and Usage
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 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
RegExpObject.multiline
Return Value
Type | Description |
---|---|
Boolean | Returns true if the "m" modifier is set, false otherwise |