grepRawsearches for substring
patternmatches within a raw vector
grepRaw(pattern, x, offset = 1L, ignore.case = FALSE, value = FALSE, fixed = FALSE, all = FALSE, invert = FALSE)
charToRawto a raw vector. Long vectors are not supported.
FALSE, the pattern matching is case sensitive and if
TRUE, case is ignored during matching.
"^"will match there.
patternis a pattern to be matched as is.
TRUEall matches are returned, otherwise just the first one.
TRUEreturn indices or values for elements that do not match. Ignored (with a warning) unless
value = TRUE.
grepRaw(value = FALSE)returns an integer vector of the offsets at which matches have occurred. If
all = FALSEthen it will be either of length zero (no match) or length one (first matching position).
grepRaw(value = TRUE, all = FALSE)returns a raw vector which is either empty (no match) or the matched part of
grepRaw(value = TRUE, all = TRUE)returns a (potentially empty) list of raw vectors corresponding to the matched parts.
fixed = TRUE.
grep, seeks matching patterns within the raw vector
x. This has implications especially in the
all = TRUEcase, e.g., patterns matching empty strings are inherently infinite and thus may lead to unexpected results.
invert is interpreted as asking to return the
complement of the match, which is only meaningful for
offset determines the start of the search, not
of the complement. Note that
invert = TRUE with
TRUE will split
x into pieces delimited by the pattern
including leading and trailing empty strings (consequently the use of
regular expressions with
"$" in that case may
lead to less intuitive results).
Some combinations of arguments such as
fixed = TRUE with
value = TRUE are supported but are less meaningful.
regexp) for the details of the pattern specification.
grep for matching character vectors.