Repository navigation
grep: allow repeat operators with nothing to repeat after ( or | - #256
yunusarda-sudo wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
==========================================
- Coverage 97.22% 97.15% -0.08%
==========================================
Files 6 6
Lines 2270 2354 +84
Branches 245 255 +10
==========================================
+ Hits 2207 2287 +80
- Misses 63 67 +4
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:
|
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
In -E mode, GNU grep accepts *, +, ? or {m,n} with nothing to repeat
anywhere an expression starts (at index 0, or after ( or |), warns
"<op> at start of expression", and treats the operator as matching the
empty string.
Generalize leading repeat operator stripping to normalize repeat
operators appearing at the start of any subexpression or alternative,
including doubled operators (e.g. **a, b|**a).
Fixes uutils#164
Signed-off-by: Yunus Arda Güney <yunusarda-sudo@users.noreply.github.com>
784bd7a to
4f929ef
Compare
In
-Emode, GNU grep accepts*,+,?or{m,n}with nothing to repeat anywhere an expression starts (at index 0, or immediately following an unescaped(or|), warns<op> at start of expression, and treats the operator as matching the empty string.This generalizes the leading repeat operator stripping logic into
normalize_ere_repeat_operators:(,|, and index 0 as start of expression.*,+,?, or{m,n}) appearing at the start of expression while emittingwarning: <op> at start of expression.**a,b|**a).\*,\(), bracket expressions ([*]), and literal{}blocks.Fixes #164