JS Built-ins
RegExpmultilinebeginner

RegExp multiline β€” gim flags

πŸ“– Usage Example
const re = /^start/m
console.log(re.multiline) // β†’ true
// ^ and $ match at line boundaries

Read RegExp.multiline to check whether the 'm' flag is set on the regular expression.

RegExp.prototype.multiline

With g, i, and m flags, multiline is true.

Challenge: Verify that /hi/gim.multiline equals true.

πŸ’‘ Hints (1)
  • β€’ multiline checks only for the m flag, regardless of other flags