We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v21.1.0
windows & linux
replace
let str = `<a name=\"_Changes\"></a><font face=\"Calibri, seri` const res = str.replace(reg, '<div id="$1" style="visibility: none;"></div>'); console.log(res);
For such a simple string, str.replace takes nearly 1 minute.
str.replace
No response
The text was updated successfully, but these errors were encountered:
This has nothing to do with Node.js, your regular expression causes catastrophic backtracking across almost every regex engine out there.
See this test and an explanation of runaway regular expressions.
If you also launch the debugger in that test you'll see almost 120k steps being walked through because of that backtracking.
Sorry, something went wrong.
Additionally, js engine bugs should be reported to V8 directly and not us, we can't fix them here anyway :)
No branches or pull requests
Version
v21.1.0
Platform
windows & linux
Subsystem
replace
What steps will reproduce the bug?
For such a simple string,
str.replace
takes nearly 1 minute.How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: