my_names <- c('a\nb\nc') library(stringr) str_extract(my_names, regex('a.*b.*', dotall=TRUE))
Standard input is empty
[1] "a\nb\nc"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!