hl_grep {emphatic} | R Documentation |
Colour highlighting a regular expression search
Description
Highlight text within an R object which matches a given regex. This only works in a terminal which supports ANSI colour codes.
There are slightly different versions of the highlighting function depending upon which text version of the object you'd like to match against:
Usage
hl_grep(
x,
pattern,
coerce = "default",
opts = hl_opts(),
fill = NULL,
text = NULL,
...,
perl = TRUE
)
Arguments
x |
character string |
pattern |
regular expression string. Note: don't get too fancy here |
coerce |
How should non-character arguments be coerced to character strings?
|
opts |
create options list |
fill |
solid colour for background. If |
text |
text colour. If |
... |
extra args passed to |
perl |
logical. use perl style regex. default: TRUE |
Value
An emphatic object suitable to output to console (for example)
Examples
hl_grep(mode, 'switch')