For example, I have a string:
sentence = ['cracked $300 million','she\'s resolutely, smitten ', 'that\'s creative [r]', 'the market ( knowledge check : prices up!']
I want to remove the punctuation and replace numbers with the '£' symbol. I have tried this but can only replace one or the other when I try to run them both. my code is below
import re
s =([re.sub(r'[!":$()[]\',]',' ', word) for word in sentence])
s= [([re.sub(r'\d+','£', word) for word in s])]
s)
I think the problem could be in the square brackets?? thank you!