RejectRegexp produces only lines that don't match the compiled regexp re.
(re *regexp.Regexp)
| 825 | |
| 826 | // RejectRegexp produces only lines that don't match the compiled regexp re. |
| 827 | func (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. |