Let's say we have a sentence like this:
sentence="thanks for coming please visit https://www.stackoverflow.com for more or look me up on https://www.linkedin.com"
sentence=as.data.frame(sentence)
I'd like to extract the first url only
This method works when a sentence contains one url, but not when there are multiple
library(qdapRegex)
#Extract Url
sentence[["URL"]] <- unlist(rm_url(sentence[["sentence"]], extract=TRUE))
Any ideas would be highly appreciated.