Skip to contents

Attach a standardized error message to a regex argument that specifies that the pattern must not be matched. This is a wrapper around regex_must_match() that sets the negate attribute to TRUE.

Usage

regex_must_not_match(regex)

Arguments

regex

(character) The regular expression pattern.

Value

The regex value with a negate attribute and with names() equal to the generated "must not match" error message.

Examples

regex_must_not_match("[aeiou]")
#> must not match the regex pattern {.val [aeiou]} 
#>                                       "[aeiou]" 
#> attr(,"negate")
#> [1] TRUE