library(stringr) y <- ('a') str_subset(string = y, regex(pattern = 'a\\b'))
Standard input is empty
[1] "a"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!