I want to extract several occurrences of some text that spans multiple lines and can be matched against a single Vim regex (using the \_ metacharacter). Unfortunately, in any case, the corresponding lines are correctly highlighted in Vim, when I add any Vim command (for example, delete or yank) after the corresponding regular expression, the command only works on the first line of each match.
Example:
1: bad_function(arg1, 2: arg2, arg3, 3: ... 4: argN); 5: good_function(); 6: ... 7: bad_function(arg2_1, 8: ... 9: arg2_N); 10: another_good_function();
If I execute :g/bad_function([^;]\+\_[^;]\+;$/d , then only lines 1 and 7 are deleted, although lines 1-4 and 7-9 are highlighted.
How to deflate / delete all matched (selected) lines?
vim regex
tombkeeper
source share