I've asked this question once but it was closed because the commenters directed me to some other posts. But those posts didnt specifically use str.replace and that's what I'm supposed to use. Maybe those worked but I still don't understand how to do it.
This is trump['source']:
trump['source'] = array(['<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>',
'<a href="http://twitter.com/download/android" rel="nofollow">Twitter for Android</a>',
'<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>',
'<a href="https://studio.twitter.com" rel="nofollow">Media Studio</a>',
'<a href="http://twitter.com/#!/download/ipad" rel="nofollow">Twitter for iPad</a>',
'<a href="http://instagram.com" rel="nofollow">Instagram</a>',
'<a href="https://mobile.twitter.com" rel="nofollow">Mobile Web (M5)</a>',
'<a href="https://ads.twitter.com" rel="nofollow">Twitter Ads</a>',
'<a href="https://periscope.tv" rel="nofollow">Periscope</a>',
'<a href="https://studio.twitter.com" rel="nofollow">Twitter Media Studio</a>'],
dtype=object)
I'm fairly new to regex so I don't really know what to do, however, this is what I have right now:
r = r'>(.*)<'
as this captures what I want and groups it.
Does anyone know how to use str.replace with regex to get get rid of the tags and replace it with just "Twitter for Iphone" etc?
Thanks