parenRE: Parenthetical Regular Expression

Description Usage Arguments Value Examples

View source: R/dynamictable.R

Description

Simplifies parenthetical extraction of matches from regular expressions

Usage

1
parenRE(RegExp, text)

Arguments

RegExp

The regular expression, presumably with one or more parenthetical components

text

The string to match. NOT vectorized

Value

If no matches found NA; Otherwise a character vector with one element per parenthetical capture

Examples

1
2
3
parenRE("(quick|lazy)\\b.+(fox|DOG)", "Quick brown fox")
## Word boundary (\b) prevents matching to "quickest":
parenRE("(quick|lazy)\\b.+(fox|DOG)", "Quickest brown fox")

maptracker/dynamictable documentation built on May 21, 2019, 11:27 a.m.