I work with R programing language. I have a data frame with one column contains url like this:
myUrl <- "https://twitter.com/UserName"
I need to get rid of everything before the last /. The regex pattern seems to be (see this)
[^/]+$
I can't find the correct function to keep UserName. I thought grep was my friend, but it does not work:
[R] grep('[^/]+$', myUrl)
[1] 1
Obviously this is not what I want. No success with other family functions. Can someone please tell me the correct command?