str_locate_braces: Locate the braces in a string.

View source: R/locate.R

str_locate_bracesR Documentation

Locate the braces in a string.

Description

Give the positions of (, ⁠)⁠, [, ⁠]⁠, ⁠\{⁠, ⁠\}⁠ within a string.

Usage

str_locate_braces(string)

Arguments

string

A character vector

Value

A data frame with 4 columns: string_num, string, position and brace. Every extracted brace amount gets its own row in the tibble detailing the string number and string that it was extracted from, the position in its string and the brace.

See Also

Other locators: str_locate_nth()

Examples

str_locate_braces(c("a{](kkj)})", "ab(]c{}"))

strex documentation built on Nov. 2, 2023, 6:04 p.m.