An infix alias for stringr::str_detect().

string %~% pattern

Arguments

string

A character vector to look for matches in.

pattern

A regular expression to look for.

Value

A logical vector indicating pattern matches.

Examples

rownames(mtcars) %~% "^Merc"
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE  TRUE  TRUE
#> [13]  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE