Skip to contents

A stringr-like function to pull out a string between two string anchors [Stable]

Usage

str_between(string, pattern1, pattern2)

Arguments

string

Input vector. Either a character vector, or something coercible to one.

pattern1

Pattern that will act as starting anchor in extraction, and be excluded. The default interpretation is a regular expression, as described in stringi::stringi-search-regex. Control options with regex().

pattern2

Pattern that will act as ending anchor in extraction, and be excluded.

Value

string or vector of strings

Examples

# str_between(stringr::fruit, "ap", "e")