I need to trim URLs after the third /
. I removed the http from the beginning to make it easier.
Example:
a.ssl.fastly.net/static/r07/auth014.js
0.tqn.com/f/f/a/a.ttf?v=3.0.1
This should return
a.ssl.fastly.net/static/r07
0.tqn.com/f/f
I tried
echo "0.tqn.com/f/f/a/a.ttf?v=3.0.1" | sed 's/.*[\/].*[\/].*[\/].*/\1/'
but it does not seem to work and throws an error :
sed: -e expression #1, char 26: invalid reference \1 on `s' command's RHS
Can anyone pls help me?