col <- c("/abc/def/hdk/database/dbclient/ibm/DB2Client-V97FP02.v01/sqllib/lib64", "/abc/def/hdk/database/dbclient/ibm/DB2Client-V97FP02.v01/sqllib/misc", "azn/external/curl-7.52.1/linux_g44.exe", "store/software/ep/rpg/external/python27-2.7.1/lib")regmatches(col, regexpr("[^/]+-(?:\\w+\\.v)?\\d+(?:\\.\\d+)*", col, perl=TRUE))
Standard input is empty
[1] "DB2Client-V97FP02.v01" "DB2Client-V97FP02.v01" "curl-7.52.1" [4] "python27-2.7.1"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!