Reputation: 481
I would like to filter the string mentioned below in python.
u'reviews': [{u'content':
Can someone please let me know to how I should create a new string like this below.
reviews: [{content:
I am aware that python provides an excellent patter matching technique but don't know how it works. Thanks in advance
Upvotes: 1
Views: 59
Reputation: 67968
import re
x="u'reviews': [{u'content':"
print re.sub(r"u'([^']*)'",r"\1",x)
You can use re.sub
for this.
Upvotes: 1