kwr_build_regex: Creates regular expression from a single string

View source: R/regex.R

kwr_build_regexR Documentation

Creates regular expression from a single string

Description

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.

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.

Value

Regular expression.

Examples

kwr_build_regex("vajíčko")

kwr_build_regex(x = "abc", and = "xyz")

MarekProkop/keywordr documentation built on Nov. 6, 2022, 11:31 a.m.