#!/usr/bin/env python import re from pprint import pprint for line in [ ' 2 1950 100% - 1050 100% 2780 100%', ' 5 2800 100% - 2330 100% - 1230 100%', ' 8 2890 100% 1530 100% - 2310 100%', ' 9 - 2160 100% 2730 100% - 2120 100%', ' 324 - 2800 100% 2650 100% - 2490 100%', ' 492 990 100% 900 100% 1660 100%', ' 890 1920 100% - 2140 100% 1480 100%', ' 1229 - 2870 100% - 1266 90% 728 68%', ' 1643 - 3000 100% - 3000 100% - 3000 100%', ' 1683 - 1021 97% 1460 100% - 2620 100%', ' 1898 - 1600 100% - 1940 100% - 1860 100%', ' 2186 1220 100% - 900 100% - 1840 100%', ' 2194 2030 100% - 1460 100% - 1080 100%', ' 2577 2810 100% - 1550 100% - 2350 100%', ' 2629 2570 100% - 2270 100% - 1430 100%', ' 3659 - 1720 100% 1240 100% - 2760 100%', ' 3978 - 920 100% 2560 100% - 2590 100%', ' 4302 348 25% - 2530 100% - 316 23%', ' 4516 - 1231 60% - 1839 75% 7 0%']: work = line.replace('%', '') parts = re.split(r"(?<=\d)\s", work) print(work) pprint(parts)