aa <- c("Session/1/Focal_011/Dave_1", "Session/2/Focal_223/Dave_2", "Session/3/Focal_23/Quentin_3", "Session/4/Focal_4/Gerald_4", "Session/5/Focal_521/Pedro_5")sub("^.*/(.*)$", "\\1", aa)
Standard input is empty
[1] "Dave_1" "Dave_2" "Quentin_3" "Gerald_4" "Pedro_5"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!