rx_break {campfin}R Documentation

Form a word break regex pattern

Description

Wrap a word in word boundary (⁠\\b⁠) characters. Useful when combined with stringr::str_which() and stringr::str_detect() to match only entire words and not that word inside another word (e.g., "sting" and "testing").

Usage

rx_break(pattern)

Arguments

pattern

A regex pattern (a word) to wrap in ⁠\\b⁠.

Value

The a glue vector of pattern wrapped in ⁠\\b⁠.

Examples

rx_break("test")
rx_break(state.abb[1:5])

[Package campfin version 1.0.11 Index]