Jul-10-2019, 05:14 AM
i want to split a string at the boundary of different classes of character values. in my current case a string has a few ranges of digits so i want something like:
way back in C i would have to implement this the hard way by scanning the string character by character and look up its class and split and step to the next result element when the character class changes, as mapped by the caller who might want everything not a digit to be grouped together. i don't want to do it that way in Python.
docs/3.4.10/python-3.4.10-pdf-letter.tar.bz2
to split up like ['docs/','3','.','4','.','10','/python-','3','.','4','.','10','-pdf-letter.tar.bz','2']
.way back in C i would have to implement this the hard way by scanning the string character by character and look up its class and split and step to the next result element when the character class changes, as mapped by the caller who might want everything not a digit to be grouped together. i don't want to do it that way in Python.