grep with negative lookbehind

Posted by Dan Fabulich on Stack Overflow See other posts from Stack Overflow or by Dan Fabulich
Published on 2010-03-22T04:19:56Z Indexed on 2010/03/22 4:21 UTC
Read the original article Hit count: 822

Filed under:
|
|
|

I'm trying to grep through a bunch of files in nested subdirectories to look for regular expression matches; my regex requires negative lookbehind.

Perl has negative lookbehind, but as far as I can tell GNU grep doesn't support negative lookbehinds.

What's the easiest way to get an equivalent to GNU grep that supports negative lookbehinds?

(I guess I could write my own mini-grep in Perl, but that doesn't seem like it should be necessary. My copy of the Perl Cookbook includes source for tcgrep; is that what I should use? If so, where's the latest version? Don't tell me I have to type this entire program!)

© Stack Overflow or respective owner

Related posts about perl

Related posts about grep