I'm trying to use grep to find lines that has any other character except + and spacing.
I've tried using
but if I test it with a text file:
++++++++ ++++++++ + ++ ++
which returns 3 empty lines.
The -c option returns 3 so I thought that spaces and newlines may be getting excluded so I tried
grep -c [^+\ ] and
grep -c [^+\n\ ]
and both still gives me 3.
I've also tried
grep -v [+]
and though this code works with my above text file, I still need it to detect lines that also contain a mixture of +'s and other characters
+1+++++ should also be included in the search, but was excluded.
What am I missing?
For clarification, on a text file like this:
++++++++ + ++ ++ +1 + abcd fgh ++++++++
I want it to return
+1 + abcd fgh