Skip to contents

A simple extension of %in%.

Usage

pattern %partin% vector

Arguments

pattern

Character string containing regular expressions to be matched.

vector

Character vector.

Value

TRUE or FALSE.

Examples

"Bei" %partin% c("Beijing", "Shanghai")  # TRUE
#> [1] TRUE
"bei" %partin% c("Beijing", "Shanghai")  # FALSE
#> [1] FALSE
"[aeiou]ng" %partin% c("Beijing", "Shanghai")  # TRUE
#> [1] TRUE