str_extract: Extract patterns from a string

View source: R/extract.R

str_extractR Documentation

Extract patterns from a string

Description

Extract patterns from a string

Usage

str_extract(string, pattern)

str_extract_all(string, pattern)

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.


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