Why is \D+ matching across new lines, despite using multiline flag?
let str = `a
b`;
// ✔
for (let match of str.matchAll (/^.+$/mg))
console.log (match);
// ✔
for (let match of str.matchAll (/^[^0-9]$/mg))
console.log (match);
// ⚠️ problem
for (let match of str.matchAll (/^\D+$/mg))
console.log (match);
/**
Output:
["a"]
["b"]
["a"]
["b"]
// ⚠️ problem
["a\nb"]
*/