gregexprwith substring retrieval
gregexprenabling retrieval of the matching substrings.
gregexpr(pattern, text, ignore.case=FALSE, perl=FALSE, fixed=FALSE, useBytes=FALSE, extract=FALSE)
fixed = TRUE) to be matched in the given character vector. Coerced by
as.characterto a character string if possible. If a character vector of length 2 or more is supplied, the first element is used with a warning. Missing values are not allowed.
as.characterto a character vector.
FALSE, the pattern matching is case sensitive and if
TRUE, case is ignored during matching.
TRUE, pattern is a string to be matched as is. Overrides all conflicting arguments.
TRUEthe matching is done byte-by-byte rather than character-by-character. See
extract=FALSE) or a list of substrings matching the pattern (
extract=TRUE). There is one list element for each string in text, and each list element contains a character vector of all matching substrings in the corresponding entry of text.
gregexprthat enables the return of the substrings matching the pattern. The last argument extract is the only difference to
base::gregexpr. The default behaviour is identical to
base::gregexpr, but setting
extract=TRUEmeans the matching substrings are returned.
Run the code above in your browser using DataCamp Workspace