Remove unnecessary zeros in IP address:
100.020.003.400 -> 100.20.3.400
001.200.000.004 -> 1.200.0.4
000.002.300.000 -> 0.2.300.0 (optional silly test)
My attempt does not work well in all cases:
import re
ip = re.sub('[.]0+', '.', ip_with_zeroes)
There are similar question but for other languages:
Please provide solutions for both Python v2 and v3.