I want to split a string into a list in python, depending on digit/ not digit. For example,
5 55+6+ 5/
should return
[\'5\',\'
Use findall or finditer:
findall
finditer
>>> re.findall(r'\d+|[^\s\d]+', '5 55+6+ 5/') ['5', '55', '+', '6', '+', '5', '/']