I have a string like below, and I want to remove all \x06 characters from the string in Python.
Ex:
s = 'test\x06\x06\x06\x06' s1 = 'test2\x04\x04\x04\x04' print(literal_eval("'%s'" % s)) output: test♠♠♠♠
I just need String test and remove all \xXX.
\x04import re; re.sub('[^A-Za-z0-9]+', '', s)