bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ed] Match empty lines?


From: John Cowan
Subject: Re: [Bug-ed] Match empty lines?
Date: Mon, 7 Jan 2019 17:59:00 -0500

On Mon, Jan 7, 2019 at 5:21 PM Simon Wilper <address@hidden> wrote:

Hi everybody,
>
> I would like to edit a document that contains some paragraphs separated by
> one
> empty line and insert text after each empty line.  Unfortunately neither
> the
> regex command /^$ nor /\`\' does match empty lines.
>

You want this (* is the prompt, use the P command to see it):

*g/^$/a\
text to be inserted
*

Now every blank line will be followed by a line containing "text to be
inserted".  If you want to insert more than one line, end every line except
the last one with a backslash.

-- 
John Cowan          http://vrici.lojban.org/~cowan        address@hidden
Most people are much more ignorant about language than they are about
[other subjects], but they reckon that because they can talk and read and
write, their opinions about talking and reading and writing are as well
informed as anybody's.  And since I have DNA, I'm entitled to carry on at
length about genetics without bothering to learn anything about it.  Not.
                        --Mark Liberman


reply via email to

[Prev in Thread] Current Thread [Next in Thread]