expr: switch to leftmost-longest regex matching behavior - #14527
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain, and all reviewed changes are covered.
Pull request overview
Updates expr to use POSIX leftmost-longest regex matching.
Changes:
- Enables
fancy-regexleftmost-longest matching. - Adds an alternation regression test.
- Updates dependency metadata and lockfile.
File summaries
| File | Description |
|---|---|
src/uu/expr/src/syntax_tree.rs |
Configures matching behavior and adds a regression test. |
Cargo.toml |
Updates and configures fancy-regex. |
Cargo.lock |
Records dependency metadata changes. |
Review details
- Files reviewed: 2/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This comment was marked as resolved.
This comment was marked as resolved.
cc75d7c to
2a2a061
Compare
thanks, added a test here too |
|
please also update Cargo.lock in fuzz/ |
done, thanks |
|
GNU testsuite comparison: |
|
cool stuff, thanks |
|
@keith-hall Should we use |
|
I would suggest to benchmark it and decide - if a match would be found at the beginning of the haystack, seeking might add unnecessary extra overhead... If the pattern is unanchored and the haystack is large, then likely it would make sense to seek. |
Fixes a bug in
exprwhereby it was using leftmost-first match semantics instead of leftmost-longest as required by POSIX