diff options
Diffstat (limited to 'it_pipe.class')
-rw-r--r-- | it_pipe.class | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/it_pipe.class b/it_pipe.class index 03d9c69..cae4eb0 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -91,7 +91,7 @@ function map($expr) } /** - * Apply an expression to every line + * Filter lines by an expression */ function filter($expr) { @@ -101,6 +101,16 @@ function filter($expr) } /** + * Filter lines by a regexp + */ +function grep($regexp) +{ + $this->lines = it::grep($regexp, $this->lines); + + return $this; +} + +/** * Select cols from tab-separated cols in each line and tab-joins them again. Key order relevant. */ function cut($picks) |