Documentation
¶
Overview ¶
Package grep implements the `grep`, `egrep`, and `fgrep` built-ins. All three share a single implementation parameterized by the default regex mode (BRE, ERE, fixed).
Flags: -E -F -i -v -n -c -l -L -H -h -r -R -w -x -o -A -B -C -e PAT -f FILE -q -s --include --exclude --color.
Multi-file output sorts filenames. Recursive output uses path/list order from the FS (filename-sorted at each directory level).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mode ¶
type Mode int
Mode is the default regex mode for a grep variant.
const ( // ModeBasic — BRE. We emulate BRE by treating the pattern as // "extended with most metacharacters escaped" — but Go has no // real BRE engine. In practice we just compile via Go's RE2 // (which accepts a strict-ERE superset); BRE-specific quirks // like `\{N,M\}` are rare in test fixtures. Matches just-bash. ModeBasic Mode = iota // ModeExtended — ERE, the Go regexp/syntax.Perl flavor minus // PCRE extensions. Same engine as ModeBasic in practice. ModeExtended // ModeFixed — literal substring matching. Patterns are NEVER // compiled as regex; `-i` lowercases both sides. ModeFixed )
Click to show internal directories.
Click to hide internal directories.