v <- c("A17-R-Null-C-3.AT2G41240", "A18-R-Null-C-3.AT2G41240", "B19-R-Null-C-3.AT2G41240", "B20-R-Null-C-3.AT2G41240", "A21-R-Transgenic-C-3.AT2G41240", "A22-R-Transgenic-C-3.AT2G41240")gsub("^[^-]*-([^.]+).*", "\\1", v)
Standard input is empty
[1] "R-Null-C-3" "R-Null-C-3" "R-Null-C-3" "R-Null-C-3" [5] "R-Transgenic-C-3" "R-Transgenic-C-3"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!