fixed {stringr} | R Documentation |
This function specifies that a pattern is a fixed string, rather than a regular expression. This can yield substantial speed ups, if regular expression matching is not needed.
fixed(string)
string |
string to match exactly as is |
Other modifiers: ignore.case
,
perl
pattern <- "a.b" strings <- c("abb", "a.b") str_detect(strings, pattern) str_detect(strings, fixed(pattern))