contains_one_of: Check if a value matches multiple regular expressions

View source: R/comparisons.R

contains_one_ofR Documentation

Check if a value matches multiple regular expressions

Description

Check if a value matches multiple regular expressions

Usage

contains_one_of(x, ..., ignore.case = FALSE)

Arguments

x

A character vector

...

unquoted or quoted regular expressions

ignore.case

A logical. If FALSE (default) case is ignored in the comparison

Value

The vector x is checked against each regular expression in the array provided. Any match results in TRUE for the element

Examples

nams=c("George Washington", "Washington DC", "King George")
contains_one_of(nams, Washington, DC)
contains_one_of(nams, ing)
contains_one_of(nams, "^Wash.*$")

qPharmetra/PMDatR documentation built on April 7, 2024, 5:42 p.m.