I have many lines containing the names of US Presidents Carter, Bush, Clinton, Obama. Some of them contain 1 of these names, some 2, some 3, some of all 4 (in any order).
I Know How To Look For Carter And Clinton And Obama β
:g/.*Carter\&.*Clinton\&.*Obama/p
I Know How To Look For Carter And (Clinton OR Bush) β
:g/.*Carter\&\(.*Clinton\|.*Bush\)/p
(There are definitely better ways to do this)
But I cannot understand how to search (and I considered related issues), for example, for Bush and Clinton NOT Carter and even less than how to search, for example, for Bush and Clinton NOT (Carter OR Obama).
vim regex
ThG 07 Oct '10 at 16:59 2010-10-07 16:59
source share