A question on .exrc while using vi

Rouben Rostamian rouben at math13.math.umbc.edu
Mon Dec 10 03:11:34 AEST 1990


A long, long time ago someone wanted help with:
>>> 	All I am trying to do is replace the 'the's by 'an's.
>>> 	That's all.

There have been several cycles of wrong or partially wrong solutions
followed by the right solution.  I am sure that the original poster
has lost interest in these followups, however since it appears that
we are at the beginning of a new cycle of Rube Goldberg-ish solutions,
I feel that I should remind those who have not been paying attention
that the correct solution is:
:%s/\<the\>/an/g

The regular expression \<the\> picks up the pattern "the" delimited
by whitespace or "the" at the beginning or end of lines.  Therefore
"theatre" does not change into "anatre".

Let's see if this ends the debate.

--
Rouben Rostamian                            Telephone: (301) 455-2458
Department of Mathematics and Statistics    e-mail:
University of Maryland Baltimore County     bitnet: rostamian at umbc
Baltimore, MD 21228,  U.S.A.                internet: rostamian at umbc3.umbc.edu



More information about the Comp.unix.questions mailing list