Lets say I have a string \"Hello.\" I want to see if this string contains a period:
text <- \"Hello.\" results <- grepl(\".\", text)
I use Jilber's approach usually but here are two other ways:
> grepl("[.]", "Hello.") [1] TRUE > grepl("[.]", "Hello") [1] FALSE > grepl(".", "Hello.", fixed = TRUE) [1] TRUE > grepl(".", "Hello", fixed = TRUE) [1] FALSE