library(stringr) line <- 'Teste @ abc @REF1' str_extract_all(line, "(?<=@)\\w+")str_extract_all(line, "(?<=@)\\w*")
Standard input is empty
[[1]] [1] "REF1" [[1]] [1] "" "REF1"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!