grepm {lares} | R Documentation |
Pattern Matching for Any or All Multiple Matches
Description
This function returns a boolean vector of the same length as 'x', each element of which is the result of applying the 'type' of matches to the corresponding element of 'x', using regular expressions.
Usage
grepm(pattern, x, type = "all", ...)
Arguments
pattern |
character string containing a regular expression
(or character string for |
x |
Character vector. Text where matches are sought, or an object which can be coerced by as.character to a character vector. Long vectors are supported. |
type |
Character. Type of match. Choose one of:
|
... |
Additional arguments to pass to |
Value
Boolean of same length as x
See Also
Other Tools:
autoline()
,
bind_files()
,
bring_api()
,
chr2num()
,
db_download()
,
db_upload()
,
export_plot()
,
export_results()
,
files_functions()
,
font_exists()
,
formatColoured()
,
formatHTML()
,
get_credentials()
,
glued()
,
h2o_selectmodel()
,
haveInternet()
,
image_metadata()
,
importxlsx()
,
ip_data()
,
json2vector()
,
list_cats()
,
listfiles()
,
mail_send()
,
markdown2df()
,
move_files()
,
msplit()
,
myip()
,
quiet()
,
read.file()
,
statusbar()
,
tic()
,
try_require()
,
updateLares()
,
warnifnot()
,
what_size()
Examples
x <- c(123, 876, 18761)
patterns <- c(1, 2)
grepm(patterns, x, type = "any")
grepm(patterns, x, type = "all")