reg_matches: 'regmatches()' with 'NA'

View source: R/parse_dttm_fmt.R

reg_matchesR Documentation

regmatches() with NA

Description

reg_matches() is a thin wrapper around regmatches() that returns NA instead of character(0) when matching fails.

Usage

reg_matches(x, m, invert = FALSE)

Arguments

x

A character vector.

m

An object with match data.

invert

A logical scalar. If TRUE, extract or replace the non-matched substrings.

Value

A list of character vectors with the matched substrings, or NA if matching failed.


sdtm.oak documentation built on April 3, 2025, 9:37 p.m.