If we're looking for /^b/
in the string aaaaaa
(and multi-line mode is not enabled), we should be smarter than to scan through every single a
before bailing.
Reduction from https://fragrantica.com/
const mb = 100;
console.log("Create " + mb + "MB string");
let s = "a".repeat(mb * 1048576);
let re = /^b/
console.log("Search for " + re + " in string");
for (let i = 0; i < 10_000; ++i) {
console.log(re.test(s));
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too