igrepl: Perform inverse regex search (C++)

View source: R/RcppExports.R

igreplR Documentation

Perform inverse regex search (C++)

Description

This function takes character vector patterns with regex patterns (or fixed strings), and searches for match in the x string. It is inverse in the meaning, that in grepl single pattern is used against multiple strings; instead, this function takes multiple patterns to fit on a single string.

Usage

igrepl(patterns, x, fixed = FALSE)

Arguments

patterns

a character vector of regex or fixed patterns.

x

a string to search for the match.

fixed

a logical, indicating whether patterns are fixed strings.

Value

Logical vector of length as patterns with true if pattern was found.

Examples

igrepl(c("today","b.* fox", "jumps over", "vigorous"),
"The quick brown fox jumps over the lazy dog", FALSE)
igrepl(c("today","brown fox", "jumps over", "vigorous"),
"The quick brown fox jumps over the lazy dog", TRUE)

NUSS documentation built on Sept. 11, 2024, 5:30 p.m.