On Wed, Dec 23, 2020 at 11:57 PM Tim Chase <v...@tim.thechases.com> wrote:
> On 2020-12-23 23:18, John Cordes wrote: > >> :g/^2 TYPE tngnote//2 NOTE /s/^2 NOTE \zs\(.*\n\(\%(\D\|3 CONC > >> \).*\n\)\+\)/\='<div > >> class="xxx">'.substitute(substitute(submatch(1), '\n3 CONC ', '', > >> 'g'), '\n', '', 'g')."<\/div>\n" > > > > The last ":g..." command I listed above is working correctly > > when there are continuation lines (i.e. at least one "3 CONC" tag > > following the "2 NOTE" tag, but I think it seems to be skipping by > > the "2 NOTE" tags which do *not* have a CONC / Continuation tag. > > Ah, while I'm not positive (so shooting from the hip here) I think you > want to change the > > \+ > > (one or more continuation lines) to just > > * > > (zero or more continuation lines) to produce > > :g/^2 TYPE tngnote//2 NOTE /s/^2 NOTE \zs\(.*\n\%(\%(\D\|3 CONC > \).*\n\)\+\)/\='<div class="xxx">'.substitute(substitute(submatch(1), > '\n3 CONC ', '', 'g'), '\n', '', 'g')."<\/div>\n" > > (I also snuck in an extra "%" in the inner \(…\) which I missed when > transcribing it earlier, but shouldn't impact the results) > > -tim > > I think that did it - on a quick check. I had tried changing that "\+" to "\=" thinking that would allow for 0 or 1 but something went wrong - can't remember exactly what right now. I should have just tried * - can't think why I didn't. Thanks again! John -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGZBEdShfP_x%3DKDQB2Gd3Yg%3DDkeBTXCSF5xWw7ZoJ%3DTgYs3_Xg%40mail.gmail.com.