Newsgroups: comp.editors Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!sugar!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Subject: Re: Regular Expression (vi type) question... Message-ID: <+DCA2R9@xds13.ferranti.com> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC References: <1991Mar28.191204.12295@cbnewsl.att.com> Distribution: na Date: Fri, 29 Mar 91 18:06:26 GMT In article <1991Mar28.191204.12295@cbnewsl.att.com> sgilley@cbnewsl.att.com (The Idealistic Cynic) writes: > Can a single regular expression be used to delete > all characters including and after the last "." > in a line? {range}s/\.[^.]*$// > (It's easy if you > assume all lines will have at least one "." in them.. > what I can't get is if they don't.) To avoid failure problems? {range}g/\.[^.]*$/s/// -- Peter da Silva. `-_-' peter@ferranti.com +1 713 274 5180. 'U` "Have you hugged your wolf today?"