I am new to python and I am trying to cut a piece of string in another string in python. I looked at other similar questions, but could not find the answer.
I have a variable that contains a list of domains that domains look like this:
http://92.230.38.21/ios/Channel767/Hotbird.mp3
http://92.230.38.21/ios/Channel9798/Coldbird.mp3
....
I want the name of the mp3 file (in this example, Hotbird, Coldbird, etc.)
I know I have to do this with re.findall (), but I have no idea about the regular expressions I need to use.
Any idea?
Update: Here is the part I used:
for final in match2:
netname=re.findall('\W+\//\W+\/\W+\/\W+\/\W+', final)
print final
print netname
What didn't work. Then I tried to do this, which only cut out the ip address (92.230.28.21), but not the name:
for final in match2:
netname=re.findall('\d+\.\d+\.\d+\.\d+', final)
print final