Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!cidsv01.cid.aes.doe.CA!afsipmh From: afsipmh@cid.aes.doe.CA (Patrick Hertel) Newsgroups: comp.editors Subject: Re: A vi question Message-ID: <1990Aug19.174035.3946@cid.aes.doe.CA> Date: 19 Aug 90 17:40:35 GMT References: <14420003@hp-lsd.COS.HP.COM> <3440002@hprnd.HP.COM> Reply-To: afsipmh@cid.aes.doe.CA (Patrick Hertel) Organization: Environment Canada Lines: 24 In article <3440002@hprnd.HP.COM> egt@hprnd.HP.COM (Eric Tausheck) writes: >> > I need to do the following in vi. >> > ccccoooossss -> cos >> >> :%s/cc*/c/g >> :%s/oo*/o/g >> :%s/ss*/s/g >> ---------- > > Wouldn't one of the following be more accurate? >:%s/cc*oo*ss*/cos/g >:%s/ccccoooossss/cos/g > I have seen a lot of answres of this type in the last fwe days but it seems obvious, to me at any rate , that the question reffered to a more general solution. ie he wants to know how to edit out the quadrupling of letters not just the specific case of ccccoooossss. I am not experienced enough with vi to supply an answer but so far I haven't seen it. -- Pat Hertel Canadian Meteorological Centre Analyst/Programmer 2121 N. Service Rd. phertel@cmc.aes.doe.ca Dorval,Quebec Environment Canada CANADA H9P1J3