Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

something_but: Match any character(s) except these at least once.

Description

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!

Usage

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

Run this code
# NOT RUN {
something_but(value = "abc")

# create an expression
x <- something_but(value = "python")

grepl(x, "R")  # should be true
grepl(x, "py") # should be false

# }

Run the code above in your browser using DataLab