x <- c("string", "string.", "string. and other")grepl("^[^.]*\\.?$", x)
Standard input is empty
[1] TRUE TRUE FALSE
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!