From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: In-Reply-To: From: "James A. Robinson" Date: Fri, 26 May 2017 14:29:37 +0000 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary="001a114b469a6468b105506e2b4c" Subject: Re: [9fans] Acme Edit to remove lines Topicbox-Message-UUID: be859508-ead9-11e9-9d60-3106f5b1d025 --001a114b469a6468b105506e2b4c Content-Type: text/plain; charset="UTF-8" You ought to be able to just add '\n' to the end of your expression in an 'x//' + 'd' command sequence. For example, "search the file for lines starting with [a-z] and delete the entire line" would be: Edit ,x/^[a-z].+\n/d On Fri, May 26, 2017 at 7:23 AM dexen deVries wrote: > given multi-line dot, spanning only part of a file, how do i construct > an Edit command to remove lines matching certain regular expression? > > wanted to delete lines starting with one particular character; without > leaving an empty line behind, thus Edit s/X.+//d is not sufficient. > > --001a114b469a6468b105506e2b4c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You ought to be able to just add '\n' to the end o= f your expression in an 'x//' + 'd'=C2=A0command sequence.<= div>For example, "search the file for lines starting with [a-z] and de= lete the entire line" would be:

Edit ,x/^[= a-z].+\n/d

On Fri, May 26, 2017 at 7:23 AM dexen deVries <dexen.devries@gmail.com> wrote:
given multi-line dot, spanning only part o= f a file, how do i construct
an Edit command to remove lines matching certain regular expression?

wanted to delete lines starting with one particular character; without
leaving an empty line behind, thus Edit s/X.+//d is not sufficient.

--001a114b469a6468b105506e2b4c--