Skip to content
New issue

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

Add a case to the warning #2965

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ <h3 id="Finding_successive_matches">Finding successive matches</h3>

<p>Also, be sure that the global flag ("<code>g</code>") is set, or it will also cause
an infinite loop.</p>

<p>In addition, when matching zero-length characters (e.g. <code>/^/gm</code>),
<code>++regexp.lastIndex</code> can be used to avoid infinite loops.</p>
Rumyra marked this conversation as resolved.
Show resolved Hide resolved
Comment on lines +187 to +189
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>In addition, when matching zero-length characters (e.g. <code>/^/gm</code>),
<code>++regexp.lastIndex</code> can be used to avoid infinite loops.</p>
<p>In addition, when matching zero-length characters (e.g. <code>/^/gm</code>),
increase its {{jsxref("RegExp.lastIndex", "lastIndex")}} each time to avoid
an infinite loop.</p>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This modification is of course the final version! 🙏 Plz merge, thx!~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just realized that the previous collaboration failure should be blamed on me for not knowing the meaning of "Resolve conversation", I shouldn't click this button. Sorry everyone (with embarrassment)!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</div>

<h3 id="Using_exec_with_RegExp_literals">Using exec() with RegExp literals</h3>
Expand Down