Hi,
I have been scratching my head all day on this as im not a regex expert.
If i have a web address like:
"https://www.facebook.com/foo/"
"https://www.facebook.is/foo/"
"https://www.facebook.lw/foo/"
"https://www.facebook.de/foo/"
"https://www.instagram.de/foo/"
"https://www.twitter.de/foo/"
"https://www.amazon.de/foo/"
These are all made up addresses
I wish to be able to just extract the middle part so the first four web addresses would produce facebook, the second instagram, the third twitter and the fourth amazon
Below is the closest I have gotten to it
test <- "https://www.facebook.com/foo/"
stringr::str_extract(test, '(?<=www.)(.*)(?=.)')
# "facebook.com/foo"
Thank you for your time