expr: Fix handling of regex range quantifiers#8010
Merged
cakebaker merged 16 commits intouutils:mainfrom May 27, 2025
Merged
Conversation
Normally, `\{` begins a range quantifier like `{n,m}`, but at the start of
an expression, there is no preceding item to apply the quantifier to.
The closing brace without related opening brace is handled literally
cbdf90e to
639310c
Compare
|
GNU testsuite comparison: |
cakebaker
reviewed
May 27, 2025
cakebaker
reviewed
May 27, 2025
cakebaker
reviewed
May 27, 2025
cakebaker
reviewed
May 27, 2025
|
GNU testsuite comparison: |
d033375 to
07caa48
Compare
It is handled in `verify_range_quantifier` function.
14e5bd5 to
ca6a10e
Compare
|
GNU testsuite comparison: |
\{ literally at the start of a regex expression120ab2e to
ddd93dc
Compare
ddd93dc to
4946922
Compare
cakebaker
reviewed
May 27, 2025
cakebaker
approved these changes
May 27, 2025
|
GNU testsuite comparison: |
Contributor
|
Good work, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes parsing and error reporting for the regex range quantifiers for
expr. The\{token is handled literally when used at the start of the regex or its subexpressions. The following closing braces\}are also handled literally until the next\{that is not at the start of an expression.Quote from #8009:
Other changes:
UnmatchedClosingBraceonigcrate'sSyntax::grepfixes: #8009