#!/usr/local/bin/perl # use strict; use warnings; print map { s{0{2,}}{0}; $_ } ; __END__ 215000007801 300000324002 890000457651 210004563401 201045139158 #### 21507801 30324002 890457651 2104563401 201045139158