On 10/3/19 8:54 AM, Matt Zand wrote: > Is it possible to output symbols which constitute non-matched parts of > text? For instance, I expect > > printf "banana\napple" | grep --invert-match --only-matching 'ban' > > to produce > > ana > apple > > or > > apple > > , but it doesn't produce anything.
Unfortunately the -v and -o options don't currently combine in that way. Perhaps they should, or perhaps another option could be added to do what you want. I'll mark this as a wishlist item.