This flag is useful especially when it's used with replace function. Let's say we have a big string that contains html and we want to extract the title from it. If we have dotAll regexp flag, we can write the code like this:
replace (unsafeRegex "^.*<title>([^<]+)</title>.*$" dotAll) "$1" bigString
It's quite quick and simple. With this, we can remove unneeded parts over multiple lines. This flag is supported by ES2018 and currently, node.js and browsers other than Internet Explorer and Firefox for Android cover that.
This flag is useful especially when it's used with replace function. Let's say we have a big string that contains html and we want to extract the title from it. If we have dotAll regexp flag, we can write the code like this:
replace (unsafeRegex "^.*<title>([^<]+)</title>.*$" dotAll) "$1" bigString
It's quite quick and simple. With this, we can remove unneeded parts over multiple lines. This flag is supported by ES2018 and currently, node.js and browsers other than Internet Explorer and Firefox for Android cover that.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll