I want to remove [\' from start and \'] characters from the end of a string.
[\'
\']
This is my text:
\"[\'45453656565\']\"
Using re.sub:
re.sub
>>> my_str = "['45453656565']" >>> import re >>> re.sub("['\]\[]","",my_str) '45453656565'