Skip to content

find: accept egrep and posix-egrep regex types to match GNU - #848

Closed
AlejandroCoronadoN wants to merge 1 commit into
uutils:mainfrom
AlejandroCoronadoN:regextype-egrep-aliases
Closed

find: accept egrep and posix-egrep regex types to match GNU#848
AlejandroCoronadoN wants to merge 1 commit into
uutils:mainfrom
AlejandroCoronadoN:regextype-egrep-aliases

Conversation

@AlejandroCoronadoN

Copy link
Copy Markdown
Contributor

GNU find accepts egrep and posix-egrep as -regextype names; both select the extended (ERE) syntax. uutils rejects them:

$ find . -regextype egrep -regex '.*'
find: Invalid regex type: egrep (must be one of 'emacs', 'grep', 'posix-basic', 'posix-extended')

They behave identically to the already-supported posix-extended. Verified against GNU with a + quantifier: egrep, posix-egrep and posix-extended all match the same paths. This maps both aliases to PosixExtended, mirroring how ed/sed already alias posix-basic.

Left out on purpose: GNU's awk, gnu-awk, posix-awk and posix-minimal-basic have small semantic differences that the onig syntaxes do not represent exactly, so they are not added here.

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.29%. Comparing base (42ddfb1) to head (1df2e56).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #848   +/-   ##
=======================================
  Coverage   92.29%   92.29%           
=======================================
  Files          35       35           
  Lines        7445     7452    +7     
  Branches      388      388           
=======================================
+ Hits         6871     6878    +7     
  Misses        433      433           
  Partials      141      141           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

Commit 1df2e56 has test result changes:

bfs testsuite:

Test results comparison:
  Current:   TOTAL: 317 / PASSED: 274 / FAILED: 38 / SKIPPED: 5
  Reference: TOTAL: 317 / PASSED: 274 / FAILED: 37 / SKIPPED: 6

Changes from main branch:
  TOTAL: +0
  PASSED: +0
  FAILED: +1

New test failures (1):
  - gnu/regextype_egrep

@codspeed-hq

codspeed-hq Bot commented Aug 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing AlejandroCoronadoN:regextype-egrep-aliases (1df2e56) with main (42ddfb1)

Open in CodSpeed

@AlejandroCoronadoN

Copy link
Copy Markdown
Contributor Author

Closing this. The bfs test gnu/regextype_egrep shows that GNU's egrep syntax is not equivalent to posix-extended: GNU accepts patterns like *.*/{l (a leading * and an incomplete { are treated as literals), while posix-extended (Oniguruma) rejects them with "target of repeat operator is not specified". So mapping egrep/posix-egrep onto PosixExtended is not correct parity. A proper fix needs an egrep-equivalent syntax, which is more involved. Sorry for the noise.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant