find_parenthesis: Helper to find first block of parenthesis

View source: R/content.R

find_parenthesisR Documentation

Helper to find first block of parenthesis

Description

This function will search for the first block of parenthesis and return it if found. Otherwise, it will return "".

Usage

find_parenthesis(text)

Arguments

text

the string/code/statement you want to parse.

Value

a substring. Either "" or the first parenthesis block.

Examples

# returns ""
find_parenthesis("3 + 5")
# returns "(3 + 5)"
find_parenthesis("2 * (3 + 5)")

evalR documentation built on Aug. 25, 2022, 5:06 p.m.