This expression is almost identical to anything_but() with one major exception, a + is used instead of a *. This means something_but() expects something whereas anything_but() expects anything including... nothing!

something_but(.data = NULL, value)

Arguments

.data

Expression to append, typically pulled from the pipe %>%

value

Expression to optionally match

References

Metacharacters: https://www.regular-expressions.info/characters.html#special

Examples

something_but(value = "abc")
#> [1] "(?:[^abc]+)"
# create an expression x <- something_but(value = "python") grepl(x, "R") # should be true
#> [1] TRUE
grepl(x, "py") # should be false
#> [1] FALSE