I have a problem with a Python string. Given a Python string with escape characters such as:
"good \nand bad and\n\t not great and awesome"
I want to split this into an array on the and
s, while also removing the stray \n
's and \t
's, such as below:
["good", "bad", "not great", "awesome"]
Is it possible to perform this in a single line with re.split()
?