When I use the normal mode and output the search result using the following input,/LOAD \d\{-}\_p\+\d\nit includes the first line,However when I use the ex-command,:g/LOAD \d\{-}\_p\+\d\n/zThe output does not show the first line (line #504 is missing).My intention is to redirect the output of the ex-command to another file, using the :redir command. How to include the first line to the search output using the ex-command?
How to get command line :g to output pattern search result including the first line?
regular expression
I think this is not caused by the :g command or the matching, but by the :z command. If you go to the LOAD line and do :z, the same thing happens.Strange workaround: Do :g/pattern/-0z