3 ms·
It's a nice idea, but I think maybe only to replace a simple egrep. grep has tons of great option like -F = fgrep; no regex - way faster -v = as mentioned in
by assafmo 9y ago
It's a nice idea, but I think maybe only to replace a simple egrep.
grep has tons of great option like
-F = fgrep; no regex - way faster
-v = as mentioned in the article
-o = print only matched input, not the entire line
-C = context, print lines before and after the match; can also be used partially with -A (after) and -B (before)
- tom_mellior 9y agoAlso, super handy: grep colors the part of the line that matched.
- burntsushi 9y agoSmall note: For GNU grep on single regexes at least, the -F flag should not impact performance. It is smart enough to see through a pattern as a literal and avoid the regex engine.
- assafmo 9y agoThanks, I didn't know this.
- dullgiulio 9y agoOf course you might still want to use fgrep to make sure + and . match with the characters and are not interpreted like regular expression operators.