MCPcopy
hub / github.com/bitfield/script / RejectRegexp

Method RejectRegexp

script.go:827–833  ·  view source on GitHub ↗

RejectRegexp produces only lines that don't match the compiled regexp re.

(re *regexp.Regexp)

Source from the content-addressed store, hash-verified

825
826// RejectRegexp produces only lines that don't match the compiled regexp re.
827func (p *Pipe) RejectRegexp(re *regexp.Regexp) *Pipe {
828 return p.FilterScan(func(line string, w io.Writer) {
829 if !re.MatchString(line) {
830 fmt.Fprintln(w, line)
831 }
832 })
833}
834
835// Replace replaces all occurrences of the string search with the string
836// replace.

Calls 1

FilterScanMethod · 0.95