\/\*.*\(\n\s\*.*\)*\n\s\*\/
is a pattern which I cooked up to match some multi-line C comments, i.e., in the format of:
/* Comment Text
* Comment Text
* Comment Text
*/
Searching for the pattern in question with hlsearch
set highlights the entire comment, but when :%g/\/\*.*\(\n\s\*.*\)*\n\s\*\//delete
is executed, it acts only on the first line of the comment. If you replace the 'delete' in the command with any other ex command, it acts similarly, influencing only the first line of the highlighted match (while typing the command, it highlights the entire comment). Why does this peculiar behavior happen? (I know this sounds like an XY problem, but my curiosity is not about my problem, but about why this solution returns this peculiar behavior).