Description Usage Arguments Details Value Author(s) See Also Examples
An extension of the function base::gregexpr
enabling retrieval of the
matching substrings.
1 2 3 4 5 6 7 8 9 |
pattern |
Character string containing a regular expression (or character string for
|
text |
A character vector where matches are sought, or an object which can be coerced by
|
ignore.case |
If |
perl |
Logical. Should perl-compatible regexps be used? Has priority over |
fixed |
Logical. If |
useBytes |
Logical. If |
extract |
Logical indicating if matching substrings should be extracted and returned. |
Extended version of base:gregexpr
that 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=TRUE
means the matching substrings
are returned.
It will either return what the base::gregexpr
would (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.
Lars Snipen and Kristian Liland.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.