Split String After Hex Values
My string: str1 = 'Text\x11\x05\x11MoreTEXT\x02HELLO\x011' I want to get all strings between \xYY. I would like to get a list like this: list1 = ['Text', 'MoreTEXT', 'HELLO', '1'
Solution 1:
Try this technique. Just substitute the hex values with spaces, then split at a series of spaces.
new_string = re.split('\s+', re.sub('[\x01-\x1f\x7f]', ' ', str1))
Post a Comment for "Split String After Hex Values"