Skip to contents

The function does the following two things:

Usage

kwr_build_regex(x, and = NULL)

Arguments

x

Input string.

and

Optional string that should be matched as well.

Value

Regular expression.

Details

  1. Accented letters in a string are replaced with a character class containing both the accented letter and the same letter without accent.

  2. If the and argument is provided, the resulting regex will match both strings in any order.

Examples

kwr_build_regex("vajíčko")
#> [1] "vaj[íi][čc]ko"

kwr_build_regex(x = "abc", and = "xyz")
#> [1] "xyz.+abc|abc.+xyz"