Jul-10-2019, 07:31 AM
I think you already asked this question in the past. Here is the solution for sequences of digits
>>> import re >>> re.split(r'(\d+)', "docs/3.4.10/python-3.4.10-pdf-letter.tar.bz2") ['docs/', '3', '.', '4', '.', '10', '/python-', '3', '.', '4', '.', '10', '-pdf-letter.tar.bz', '2', '']