fork download
  1. import re
  2. texts = ['0.0.4.1','7.51.4.1','0.1.4.1']
  3. for text in texts:
  4. m = re.fullmatch(r'(?:0+\.)*(\d+(?:\.\d+)*)', text)
  5. if m:
  6. print(m.group(1))
Success #stdin #stdout 0.02s 9504KB
stdin
Standard input is empty
stdout
4.1
7.51.4.1
1.4.1