Documentation
¶
Overview ¶
Package matcher scans a file line-by-line for occurrences of one or more patterns, returning hits with line/column information.
Two modes:
- literal (default): byte-fast substring search via strings.Index, optionally requiring a UTF-8 word boundary around the match. A search for `технология` doesn't fire inside `вижутехнологияя` thanks to the boundary check using utf8.DecodeRune.
- regex (Options.Regex): each pattern is compiled with regexp.Compile; case-insensitive mode prepends `(?i:...)` to the pattern. Word boundary is ignored — the user controls it via `\b`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSkip = errors.New("matcher: file skipped (binary or over-long line)")
ErrSkip signals that a file should be silently skipped rather than failing the whole scan — it is binary, or has a line longer than the scanner's buffer (minified bundles, lock files, source maps). Callers (grep, xref) count these and continue.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.