str_extract_sandwich: Extracts strings sandwiched between specified strings

View source: R/str_extract_sandwich.R

str_extract_sandwichR Documentation

Extracts strings sandwiched between specified strings

Description

Extracts strings sandwiched between specified strings.

Usage

str_extract_sandwich(string, start_pattern, end_pattern, perl = FALSE)

Arguments

string

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

start_pattern

Specifies the first character of the string to be extracted. It must be different from the last character, end_pattern.

end_pattern

Specifies the last character of the string to be extracted. It must be different from the first character, start_pattern.

perl

logical. Should Perl-compatible regexps be used?

Details

The specified string must be a single character or three characters including the escape, and the first and last characters of the string must be different.


indenkun/infun documentation built on April 17, 2025, 2:52 p.m.