Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

something: Match any character(s) at least once.

Description

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

Usage

something(.data = NULL)

Arguments

.data

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

References

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

Examples

Run this code
# NOT RUN {
something()

# construct an expression
x <- something()

grepl(x, "something!") # this should be true
grepl(x, "")           # this should be false
grepl(anything(), "")  # this should be true

# }

Run the code above in your browser using DataLab