On Mon, Mar 31, 2014 at 5:54 PM, Daniel Peyrolon <tuchalia@gmail.com> wrote:Yes. (In the version I gave, the replacement of the second $, the one
>> Edit , x/^[^ ]+[ ]*[^(]*\([^)]*\)[ ]*\{[ ]*\n/ s/[ ]*\{[ ]*\n/\n\{/g
>
> So, it was simply a matter of changing "$" for "\n" at the x command!
in the s command, by \n was superfluous.)
In the original version, the x command matches up to the end of the
> How come my command didn't work?
> It really should work with the "$", shouldn't it?
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.