matchOne: Function matchOne

matchOneR Documentation

Function matchOne

Description

Search for first match to argument pattern within each element of a character vector. Returns corresponding substrings (compare stringr::str_match).

Usage

matchOne(string = NA, pattern = ".*", value = T, ...)

Arguments

string

Character vector where matches are sought.

pattern

Character string containing a regular expression (or character string for fixed = TRUE) to be matched in the given character vector.

value

Logical value. If T (default) returns substrings. Otherwise returns positions.

Examples

matchOne(string=c("Hello world","Hello"),pattern="wo.*")

AndreasFischer1985/quantqual documentation built on June 20, 2022, 4:55 p.m.