I have this text https://bitbucket.com/user/repo.git
and I want to print repo
, the content between /
and .git
, without including delimiters. I have this:
echo https://bitbucket.com/user/repo.git | grep -E -o '\/(.*?)\.git'
But it prints /repo.git
. How can I print just repo
?