When dealing with string-manipulation functions in programming languages, the notion of regular expressions sometimes arises. In R, you must pay attention to this point when using the string functions
A regular expression is a kind of wild card. It’s shorthand to specify broad classes of strings. For example, the expression
"[au]" refers to any string that contains either of the letters a or u. You could use it like this:
> grep("[au]",c("Equator","North Pole","South Pole"))  1 3
This reports that elements 1 and 3 of
("Equator","North Pole","South Pole")—that is, “Equator” and “South Pole”—contain either an a or a u.
A period (
.) represents any single ...