matching_parens: Matching Parentheses

View source: R/parens.R

matching_parensR Documentation

Matching Parentheses

Description

Finds matching parentheses in a string. Returns a data frame with each row representing a matching pair of parentheses, 'op' being the opening position and 'cl' being the closing position. If processed in row order, you should never see an outer set before its inner set(s)

Usage

matching_parens(text)

Arguments

text

Value

data frame with matching pair positions

Examples

txt <- "((x + 5) * (y - 7)) / (z^2 + 4)"
matching_parens(txt)


JahNorr/orrr documentation built on Jan. 29, 2025, 5:11 p.m.