library(stringr) myvec<-c("increa_0_1-1","increa_9_25-112","increa_25-50-76" ) str_match(myvec, "_([0-9]+)")[,2]
Standard input is empty
[1] "0" "9" "25"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!