grep

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileLineByLine

func FileLineByLine(r io.Reader, re *regexp.Regexp) chan string

func FileLines

func FileLines(r io.Reader, re *regexp.Regexp) []string

func FileMatch

func FileMatch(r io.Reader, re *regexp.Regexp) bool

func LineByLine

func LineByLine(path string, re *regexp.Regexp) (chan string, error)

LineByLine returns each line of the file matching the regex

func Lines

func Lines(path string, re *regexp.Regexp) ([]string, error)

func Match

func Match(path string, re *regexp.Regexp) bool

Match returns true if any lines of the file match the regex

func Matches

func Matches(path string, re *regexp.Regexp, n int) []string

Matches returns maximum n number of matches from the file.

n > 0: at most n matches
n == 0: the result is nil (zero matches)
n < 0: all matches

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL