str_extract_before: Extract string content with lookarounds

View source: R/string-handling.R

str_extract_beforeR Documentation

Extract string content with lookarounds

Description

Extracts content of strings that appear before or after a pattern.

Usage

str_extract_before(
  string,
  pattern,
  match = "^.*",
  negate = FALSE,
  cut.right = TRUE,
  cut.left = TRUE
)

str_extract_after(
  string,
  pattern,
  match = ".*$",
  negate = FALSE,
  cut.right = TRUE,
  cut.left = TRUE
)

Arguments

string

Character value.

pattern

The regular expression that matches the part of the string before/after which is looked. (Not included in the output.)

match

The regular expression that is matched to the part of the string before/after pattern.

cut.left, cut.right

Logical value. If TRUE, empty space of the remaining string is removed on the left/right side. Defaults to TRUE.

Value

Character value.


kueckelj/confuns documentation built on June 28, 2024, 9:19 a.m.