http://www.perlmonks.org?node_id=1016424


in reply to Grep'ping on Unix without perl-compatible gnu grep - can you do it better?

Tommy:

I'd do it like this:

$ grep -E '^[^#]*foo' boom now is the foo for all $ cat boom now is the foo for all now # foo is the blarg

...roboticus

When your only tool is a hammer, all problems look like your thumb.