Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!meyering From: meyering@cs.utexas.edu (Jim Meyering) Newsgroups: comp.editors Subject: Re: A vi question Keywords: substitute, vi Message-ID: <860@ai.cs.utexas.edu> Date: 13 Aug 90 01:03:51 GMT References: <1990Aug12.194738.7902@ecn.purdue.edu> Distribution: na Organization: U of TX at Austin CS Dept Lines: 19 In article <1990Aug12.194738.7902@ecn.purdue.edu> patkar@amide.ecn.purdue.edu (The Silent Dodo) writes: > I need to do the following in vi. [ Change text like "ccccoooossss" to "cos" ] > :1,$s/\(a-zA-Z)\)\1\1\1/\1/g [ doesn't work ] If your "in vi" requirement is strict, I'm not sure I can help. Otherwise, `sed' can do it. From in vi, :%!sed 's/\([a-zA-Z]\)\1\1\1/\1/g' works for me. (It looks like maybe you had an extra right paren and forgot the square brackets) Regards, -- Jim Meyering meyering@cs.utexas.edu