First ANSI sequences will be stripped with ansi_strip()
, both
ansi_grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE, ...)
ansi_grepl(pattern, x, ...)
Character scalar, regular expression or fixed string
(if fixed = TRUE
), the pattern to search for. Other objects will be
coerced using as.character()
.
Character vector to search in. Other objects will be coerced
using as.character()
.
Passed to base::grep()
.
Extra arguments are passed to base::grep()
or base::grepl()
.
The same as base::grep()
and base::grepl()
, respectively.
Note that these functions work on code points (or bytes if
useBytes = TRUE
), and not graphemes.
Unlike base::grep()
and base::grepl()
these functions do not special
case factors.
Both pattern
and x
are converted to UTF-8.