How to do a non-greedy match in grep?

后端 未结 7 2104
深忆病人
深忆病人 2020-11-30 17:30

I want to grep the shortest match and the pattern should be something like:


...
...
...

... mean

7条回答
  •  余生分开走
    2020-11-30 17:44

    I know that its a bit of a dead post but I just noticed that this works. It removed both clean-up and cleanup from my output.

    > grep -v -e 'clean\-\?up'
    > grep --version grep (GNU grep) 2.20
    

提交回复
热议问题