From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 1 Apr 2014 09:24:49 +0200 Message-ID: From: Mark van Atten To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] Acme, Edit, code and newline Topicbox-Message-UUID: d41dc350-ead8-11e9-9d60-3106f5b1d025 On Mon, Mar 31, 2014 at 5:54 PM, Daniel Peyrolon wrote: >> Edit , x/^[^ ]+[ ]*[^(]*\([^)]*\)[ ]*\{[ ]*\n/ s/[ ]*\{[ ]*\n/\n\{/g > > So, it was simply a matter of changing "$" for "\n" at the x command! Yes. (In the version I gave, the replacement of the second $, the one in the s command, by \n was superfluous.) > How come my command didn't work? > It really should work with the "$", shouldn't it? In the original version, the x command matches up to the end of the line, but the resulting selection is no longer itself a line; so the subsequent s command, trying to match various things and then the empty string at the end of a line ($), does not succeed. But replacing, in the x command, the $ by \n leaves the result of a match (now one character longer because it includes the \n) a line, in which the s command then successfully matches $. As ever, Mark.