[PLUG] simple grep/regex question

Jeme A Brelin jeme at brelin.net
Mon Apr 14 18:54:26 UTC 2008


On Mon, 14 Apr 2008, Galen Seitz wrote:
> I've tried these:
>  grep '[^;]*bit' foo.asm   # matches all bit

That's because the "bit" is preceeded by one or more non-; characters.

Make sure you match the start of the line in your regex and you're good:

grep "^[^;]*bit" foo.asm  # matches what you need!

J.



More information about the PLUG mailing list