urls <- c('https::abc/efg/hij/', 'https::abc/efg/hij/lmn/', 'https::abc/efg/hij/lmn/opr/')gsub('^.*/(?=[^/]*/$)', '', urls, perl = TRUE)
Standard input is empty
[1] "hij/" "lmn/" "opr/"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!