I have the following file path with uuid incapsulated within it's path:
I want to extract it using regular expression. I know that I can just
unlist(strsplit(string, "/")) and take the 7th element but it seems to me too slow and not efficient problem solving.
Here is what I have tried so far:
I am keep trying to play with this, please advise.
I want to extract the uuid:
Here's a slightly hacky but compact and regex-free solution:
basename(dirname(x)) # "0b27ea5fad61c99d"
x <- "~/My_Files/F0/F1/F2/0b27ea5fad61c99d/0b27ea5fad61c99d/2015-04-1-04-25-12-925"