Reputation: 67
The issue may be the fact that I am ignoring multiple strings, but here is what I'm doing at the moment:
grep -Ev 'lost+found|controller|config'
All lines with 'controller' and 'config' are being ignored, but all lines with 'lost+found' are still appearing. Is there a workaround to ignore strings that include the '+' symbol?
Upvotes: 2
Views: 314
Reputation: 3348
Dealing with lost+found|controller|config
:
lost+found
matches 1 or more occurrences of t
in lostttt
.
As @zwer and @Barmar mention, a +
indicates repetition.
Effectively, what is matched is:
Changing the +
to a \+
(escaping the special character) now matches what you need:
Regex101 is a great resource to explore what your regex does:
Upvotes: 4