Bug 263268 - bsdgrep: support empty subexpressions
Summary: bsdgrep: support empty subexpressions
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 230332
  Show dependency treegraph
 
Reported: 2022-04-13 21:03 UTC by Li-Wen Hsu
Modified: 2024-04-29 08:32 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Li-Wen Hsu freebsd_committer freebsd_triage 2022-04-13 21:03:03 UTC
$ echo foo | egrep "|foo"
egrep: empty (sub)expression

more complex case: "^${user}(|[[:space:]]+.*)$"
Comment 1 Ed Maste freebsd_committer freebsd_triage 2022-04-14 14:28:42 UTC
To address specific instances of this (before bsdgrep receives a change) one could also translate (|foo) to (foo)? e.g. "^${user}([[:space:]]+.*)?$"