Path: utzoo!attcan!uunet!husc6!think!ames!killer!tness7!tness1!nuchat!sugar!ficc!peter From: peter@ficc.UUCP (Peter da Silva) Newsgroups: comp.unix.questions Subject: Re: VI - Bug or feature????? Keywords: regular expression, search, help Message-ID: <1149@ficc.UUCP> Date: 25 Jul 88 15:47:51 GMT References: <1244@potpourri.UUCP > <394@piring.cwi.nl> Organization: SCADA Lines: 16 In article <394@piring.cwi.nl>, hansm@cwi.nl (Hans Mulder) writes: > I agree with you that this behaviour is incorrect. But I am afraid it is > not easy to repair. The cause of the problem seems to be that vi is based > on a line editor (ex, a derivative of ed). Ex has this routine that finds > all non-overlapping matches on the current line, which is very handy for the > :s/pat/repl/g command, but not quite what vi should have borrowed. I disagree. This behaviour is correct. I have used an editor on the PC that does what you suggest -- terminate closures with the shortest match -- and it's very irritating. You can't emulate long closures with a short closure regular expression, but you can do the opposite -- emulate short closures with a long closure RE. It's almost always better to use the more general method. -- Peter da Silva `-_-' Ferranti International Controls Corporation. "Have you hugged U your wolf today?" (uunet,tness1)!sugar!ficc!peter.