str_detect: Detect presence/absence of pattern

View source: R/detect.R

str_detectR Documentation

Detect presence/absence of pattern

Description

Detect presence/absence of pattern

Usage

str_detect(string, pattern, negate = FALSE)

Arguments

string

Character vector of strings.

pattern

A pattern to match. Can be:

  • A single string or regex(), to use POSIX 1003.2 extended regular expression.

  • fixed() to use a fixed/literal matchi.

  • perl() to use a Perl-compatible regular expression.

Unlike stringr, pattern must be length 1; it will not be recycled to the same length as string.

negate

If TRUE, return non-matching elements.


hadley/stringb documentation built on Sept. 16, 2023, 9:11 p.m.