Select Line Indices Based on Numeric Positions or Regex Delimiters
dot-grep_lines.RdComputes a vector of line indices either directly from numeric input or by identifying a contiguous block of lines delimited by regular expression matches.
Details
If lines is numeric, it is returned as-is. If lines is a
character string, it must be a single regex of the form
"start|end", where start and end are regular
expressions matched against x. The returned indices span from
the first match of start to the first match of end
(inclusive). If only one regex is provided, it is used for both start
and end.
When lines is NULL, the function currently returns
1:length(lines), which evaluates to an empty integer vector.