fixed {stringr}R Documentation

Match fixed characters, not regular expression.

Description

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.

Usage

  fixed(string)

Arguments

string

string to match exactly as is

See Also

Other modifiers: ignore.case, perl

Examples

pattern <- "a.b"
strings <- c("abb", "a.b")
str_detect(strings, pattern)
str_detect(strings, fixed(pattern))

[Package stringr version 0.6 Index]