Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!malgudi!caen!umich!vela!m.cs.uiuc.edu!wuarchive!decwrl!world!ekw From: ekw@world.std.com (Elliott C Winslow) Newsgroups: comp.editors Subject: Re: VI question Summary: : \([A-Z][A-Z][A-Z][A-Z]\) \([A-Z][A-Z][A-Z][A-Z]\)/\1,\2^M Message-ID: <1991Apr17.072648.15462@world.std.com> Date: 17 Apr 91 07:26:48 GMT References: <1991Apr16.234809.23553@massey.ac.nz> Sender: Elliott Winslow Distribution: the world Organization: The World @ Software Tool & Die Lines: 27 In article <1991Apr16.234809.23553@massey.ac.nz> R.Singh@massey.ac.nz (R. Singh) writes: >Get VI to recognize a pattern of two 4 lettered uppercase words and insert >a comma in them >for eg >XHLP XCEL >APPL XCEL >STAK WILD >STAK WILD >STAK WILD >and make them >XHLP,XCEL >APPL,XCEL >STAK,WILD >STAK,WILD >STAK,WILD That does it once per line; you want multiple, stick the ubiquitous '/g' at the end (no quotes). BTW, this has been a great newsgroup for learning the tricks to vi. Thanks to all. --Elliott