Repository navigation
grep: allow ERE repeat operators after ^ and $ anchors - #251
yunusarda-sudo wants to merge 2 commits into
Conversation
Warn and strip repeat operators following `^` (matching GNU grep's `<op> at start of expression`), and accept repeat operators following `$` silently (keeping `$` for positive minimums and `($|)` when zero repetitions are allowed). Fixes uutils#206
Merging this PR will not alter performanceWarning uutils has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed. 1 warning
Comparing Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #251 +/- ##
=======================================
Coverage 97.19% 97.20%
=======================================
Files 6 6
Lines 2248 2322 +74
Branches 243 256 +13
=======================================
+ Hits 2185 2257 +72
- Misses 63 65 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
In extended mode (
-E), GNU grep accepts a repetition operator immediately following^or$:^(e.g.^*q,(^+q)), it warns<op> at start of expressionand searches as^.$(e.g.q,jo$+), it accepts it silently ($whenmin >= 1, or($|)when zero repetitions are allowed).This normalizes unescaped, out-of-bracket anchor-followed repeat operators in
RegexMode::Extendedbefore Oniguruma compilation.Fixes #206
Investigated and verified locally with
cargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo test.