Unfortunately I suck at regexp. If I have a path like so:
/long/path/to/file, I just need to extact file.
/long/path/to/file
file
If someone supplies
What about this?
> path <- "/long/path/to/file" > require(stringr) > str_extract(path, "[^/]*$") [1] "file"