[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Regexp] inverse matching such as [^a] not working
From: |
jon |
Subject: |
RE: [Regexp] inverse matching such as [^a] not working |
Date: |
Wed, 19 May 2004 10:17:05 -0700 |
> This is how I invoked grep.
>
> cat foo | grep -e '[^a]\+'
[snip]
> Doesn't the preceeding grep
> invocation mean "look for strings that do not contain an `a'? I
No. It means "look for strings that contain one or more characters that are
not a."
Which begs the question... you say the output of that command is the entire
file. For me, it's everything except the first line (a by itself).
Keep in mind that newlines could affect this depending upon whether they are
stripped by your implementation of grep.
Later