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
If I understand correctly, you could use the basename function.
basename
f <- "/long/path/to/file" basename(f) # [1] "file"