I am trying to get sed to match the last part of the url and output exactly that. For instance:
echo "http://randomurl/suburl/file.mp3" | sed (expression)
should produce the result:
file.mp3
So far I have tried sed 's|\([^/]+mp3\)$|\1|g', but it just displays the whole URL. Maybe there is something I don’t see here, but in any case, help would be greatly appreciated!
source
share