I have scraped a webpage using beautiful soup.
I'm trying to get rid of a '
[u'\nWong; Voon Hon (Singapore, SG
Kandasamy; Ravi (Singapore, SG
Narasimalu; Srikanth (Singapore, SG
Larsen; Gerner (Hinnerup, DK
Abeyasekera; Tusitha (Aarhus N, DK
You need to escape the newline character (double "\"):
rep=["[","u'","\\n"] for r in rep: wr=wr.replace(r,"")
This is the same as @cricket_007's answer, however, the second part from his answer does not work for me. To my knowledge, str.replace() does not support these kind of regular expression lookups.