Thanks a lot Pratik.
From: Pratik Vyas <m(a)pd.io>
Sent: Sun, 26 Jan 2014 16:08:24
To: "GNU/Linux Users Group, Mumbai, India"
<linuxers(a)mm.ilug-bom.org.in>
Subject: Re: [ILUG-BOM] [OT] Help on Vi Command
Hi Joel,
On Sun, Jan 26, 2014 at 3:57 PM, Joel A Divekar
<joel_divekar(a)rediffmail.com> wrote:
>
> Hi All
> I am trying to do the following
> Search for all lines starting with INSERT command and
append ; at End of Line
>
> I am aware about search and replace using
> :%s/^INSERT/$;/g
> but this replaces INSERT and not append ; at end of the
line. Kindly help
> Regards
>
Try,
:%s/^INSERT\(.*\)$/\0\&nbsp\;/g
ie. Capture everything after the INSERT and replace it by itself (\0)
and the text you want you append.
>
> Joel Divekar
> --
>
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers
Thanks.
Pratik
--
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers