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            


Reply via email to