Documentation
¶
Overview ¶
Package grepcmd implements grep(1) per the GNU grep manual: print lines of each FILE (or standard input) that match PATTERNS.
Pattern dialects:
- Default (BRE) is translated construct-by-construct — see bre.go. Patterns without back-references use RE2; patterns with \1..\9 use pkg/bre's bounded backtracking matcher.
- -E (ERE): patterns without back-references use RE2 after translation of POSIX bracket expressions and GNU word-edge anchors; patterns with \1..\9 use pkg/bre's bounded backtracking matcher.
- -F: fixed strings.
Binary files (NUL byte within the first 32 KiB) print one "Binary file NAME matches" line instead of the matching lines, per GNU behavior. -c/-l/-L/-q are unaffected by binary detection.
--include/--exclude rules are applied in command-line order; the last matching rule wins. Recursive entries match by base name, while explicit command-line files match any slash-delimited name suffix, per GNU.
Click to show internal directories.
Click to hide internal directories.