my_names <- c('ondasabc123 xyz', 'ondassss') library(stringr) str_extract(my_names, 'ondas.*') str_extract(my_names, 'ondas+')
Standard input is empty
[1] "ondasabc123 xyz" "ondassss" [1] "ondas" "ondassss"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!