Let's translate one by one:
:/\_.\{-}PATTERN/d
, it deletes only the line containing "PATTERN".:1,/\_.\{-}PATTERN/d
, it deletes all lines from line 1 to the line containing "PATTERN".:1,/PATTERN/s/\_.\{-}PATTERN/
, it deletes everything up to and including the second "PATTERN".:1,/PATTERN/s/\_.\{-}PATTERN/PATTERN
, this one makes no sense, I reckon it's simply something you misunderstood. It replaces everything up to second "PATTERN" with "PATTERNPATTERN". Why? the substitution operates on the range line by line, and since the pattern includes "PATTERN", it effectively appends another "PATTERN" after the first match.:1,/PATTERN/-1s/\_.\{-}PATTERN/
, it deletes everything up to the first occurrence of "PATTERN".