regexp(s, pat, ignorecase = FALSE, once = FALSE, split = FALSE)
regexpi(s, pat, once = FALSE, split = FALSE)
FALSE
.start
and end
as numeric vectors
indicating the start and end positions of the matches.match
contains each exact match, and split
contains the
character vector of splitted strings.If no match is found all components will be NULL
, except
split
that will contain the whole string if split = TRUE
.
split
is choosen, the
splitted strings will also be returned.
regexpr
s <- "bat cat can car COAT court cut ct CAT-scan"
pat <- 'c[aeiou]+t'
regexp(s, pat)
regexpi(s, pat)
Run the code above in your browser using DataLab