Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!samsung!uunet!maverick.ksu.ksu.edu!hoss!hoss.unl.edu!sanjiv From: sanjiv@hoss.unl.edu (Sanjiv K. Bhatia) Newsgroups: comp.editors Subject: Re: ex search & substitution question Message-ID: <1990Aug07.174235.28911@hoss.unl.edu> Date: 7 Aug 90 17:42:35 GMT References: <3440001@hprnd.HP.COM> <26814@nigel.ee.udel.edu> Sender: news@hoss.unl.edu (Network News Administer) Organization: Computing Resource Center, University of Nebraska Lines: 22 In article <26814@nigel.ee.udel.edu> new@ee.udel.edu (Darren New) writes: >In article <3440001@hprnd.HP.COM> brent@hprnd.HP.COM (Brent McInnis) writes: >>But to perform it on a *range* of lines (say, lines 10 thru 20), I >>*want* to say >>:10,20/^#[iut]55/s/55/71/ > >Try >:10,20g/^#[iut]55/s/55/71/ > >I think you can give a range to the g command to have it operate on the lines >within the range that also match the pattern. -- Darren Here is my $0.02 worth. I prefer to use the substitute command 's'. :10,20s/^#[iut]55/77/ Sanjiv -- Sanjiv K. Bhatia Department of Computer Science sanjiv@fergvax.unl.edu Ferguson Hall 115 voice: (402)-472-3485 University of Nebraska - Lincoln fax: (402)-472-7767 Lincoln, NE 68588-0115