I can think of two expressions offhand that may work for you. They both worked on some quick, limited test data I tried. The first expression is
\(.\{-},\)\{2,}
This translates to "match at least 2 sequences of (as few as possible of anything followed by a comma)." In other words this tries to find matches of two or more sequences of comma-delimited text ranges.
Another is
.\{-},\@<=.*,
Which is "find anything followed by a comma, but only if immediately prior to that you could find as few as possible of anything followed by a comma."
I'm not sure if one or the other is more preferable. I find the first one easier to reason about, even though I came up with the second, more complex one first. You may need to anchor them with ^
to the start of the line.
Karl Yngve Lervåg's answer has an even simpler regex that works just as well as my overengineered options.
With them, you can use the global
command (:help global
) to operate on the matching lines with some Ex command: :g/.\{-},\@<=.*,/d
for example, will delete all the lines with more than one comma in them.
/,.*,/