in reply to Remove zero padding from excel mangled Ip addresses
Sounds like you want to remove leading zeroes, which appear to be defined as: one or more zeros that appear at the beginning of the line or following a dot or comma, and preceding a digit. This probably won't be the shortest or most elegant method, but it uses simple concepts and doesn't require any recent regex features:
s/(^|[.,])0+(\d)/$1$2/g;
Aaron B.
My Woefully Neglected Blog, where I occasionally mention Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remove zero padding from excel mangled Ip addresses
by GrandFather (Saint) on Mar 21, 2012 at 01:54 UTC | |
by aaron_baugher (Curate) on Mar 21, 2012 at 04:26 UTC |