Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher reproduces `grep -E -f` over a pattern list with bounded memory.
func Compile ¶
Compile builds a Matcher from ERE patterns (one per line, as in build_prefilter's $_pf: line-anchors already stripped). A pattern that fails RE2 compilation is skipped from the confirm step but its literal anchor (if any) still contributes to the prefilter (fail-open to a candidate, never a false negative). Returns an error only if NO pattern is usable.
func (*Matcher) Filter ¶
Filter streams lines from r and writes the matching ones to w (drop-in for grep -E -f). Lines are matched without their trailing newline; the newline is preserved on output.
func (*Matcher) MatchLine ¶
MatchLine reports whether grep -E -f would keep this line (any pattern matches).