Skip to content

Conversation

@sroiis
Copy link

@sroiis sroiis commented Dec 6, 2025

Fixes #42270

Added a note explaining that x{n}? behaves the same as x{n} because {n} is fixed-length and the lazy modifier has no effect.

Description

Clarifies the behavior of x{n}? by adding a note explaining that it behaves the same as x{n}.

Motivation

This avoids confusion by clearly stating that the ? lazy modifier has no effect on fixed-length quantifiers like {n}.

Additional details

Documentation-only change. No code or behavior is modified.

Related issues and pull requests

Fixes #42270

Added a note explaining that `x{n}?` behaves the same as `x{n}` because `{n}` is fixed-length and the lazy modifier has no effect.
@sroiis sroiis requested a review from a team as a code owner December 6, 2025 17:26
@sroiis sroiis requested review from Josh-Cena and removed request for a team December 6, 2025 17:26
@github-actions github-actions bot added Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed labels Dec 6, 2025
…t/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
<li><code>/&#x3C;.*?>/</code> will match "&#x3C;foo>"</li>
</ul>
<p>
<b>Note:</b> Adding <code>?</code> after <code>{n}</code> doesn't change the match.
Copy link
Contributor

Choose a reason for hiding this comment

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

[markdownlint] reported by reviewdog 🐶
error MD033/no-inline-html Inline HTML [Element: b]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syntactically valid, but pointless example for non-greedy modification of an exact-number quantifier

1 participant