I have a df:
dput(df) structure(list(URLs = c("http://bursesvp.ro//portal/user/_/Banco_Votorantim_Cartoes/0-7f2f5cb67f1-22918b.html", "http://46.165.216.78/.CartoesVotorantim/Usuarios/Cadastro/BV6102891782/", "http://www.chalcedonyhotel.com/images/promoc/premiado.tam.fidelidade/", "http://bmbt.ro/portal/a3/_Votorantim_/VotorantimCartoes2016/0-7f2f5cb67f1-22928b.html", "http://voeazul.nl/azul/")), .Names = "URLs", row.names = c(NA, -5L), class = "data.frame")
It describes different URLs and I am trying to count the number of characters of the host name , regardless of whether it is the actual name ( http: //hostname.com / .... ) Or IP ( http://000.000.000.000/ ... ). However, if this is the actual name, then I only want nchar between www. and .com. If it is IP, then all its numbers and "between them."
Expected result for the above sample data:
exp_outcome 1 8 2 13 3 15 4 4 5 7
I tried to do something with strsplit but could not get there.
Sotos source share