On Wed, Jan 23, 2019 at 9:41 PM Grant Edwards <grant.b.edwa...@gmail.com> wrote: > > On 2019-01-23, Alexander Kapshuk <alexander.kaps...@gmail.com> wrote: > > > This any better? :-) > > > > echo '198.088.0.01 > > 198.088.062.01 > > 198.088.0.001' | sed -r 's/\.0+([^.0]+)/.\1/g' > > I guess it's 'better', but it's still broken: > > $ echo '003.4.5.6' | sed -r 's/\.0+([^.0]+)/.\1/g' > 003.4.5.6 > > This is not a good application for a regex. > > -- > Grant Edwards grant.b.edwards Yow! I have accepted > at Provolone into my life! > gmail.com > > The OP stated that there were no leading zeros in the first octet of the IP address, so that case did not need to be handled.
- Re: [gentoo-user] OT scripting - stri... Alexander Kapshuk
- Re: [gentoo-user] OT scripting - ... Paul Colquhoun
- Re: [gentoo-user] OT scripti... Alexander Kapshuk
- Re: [gentoo-user] OT scr... Wols Lists
- Re: [gentoo-user] OT scr... Michael Orlitzky
- [gentoo-user] Re: OT scr... Grant Edwards
- Re: [gentoo-user] Re: OT... Neil Bothwick
- Re: [gentoo-user] Re: OT... Kai Peter
- Re: [gentoo-user] Re: OT... Alexander Kapshuk
- [gentoo-user] Re: OT scr... Grant Edwards
- Re: [gentoo-user] Re: OT... Alexander Kapshuk
- Re: [gentoo-user] Re: OT... Michael Orlitzky
- [gentoo-user] Re: OT scr... Grant Edwards
- Re: [gentoo-user] Re: OT... Michael Orlitzky
- Re: [gentoo-user] Re: OT... Gerrit Kühn
- Re: [gentoo-user] Re: OT... Michael Orlitzky
- Re: [gentoo-user] Re: OT... Kai Peter
- Re: [gentoo-user] Re: OT... Michael Orlitzky
- Re: [gentoo-user] Re: OT... Kai Peter
- Re: [gentoo-user] OT scripting - strip zero if bet... François-Xavier CARTON