Description Usage Arguments Details Examples
This is an infix operator for case-insensitive substring extraction via regex. Matching is non-greedy, i.e., only the first match is returned.
1 | string %e% pattern
|
string |
A character vector. |
pattern |
A regular expression. |
It's implemented as str_extract(x, regex('pattern', TRUE))
and like
sub(x, 'inverse-pattern', '', ignore.case = TRUE)
.
1 2 | 'APPLE' %e% '\\w{3}' == 'APP'
'BANANA' %e% 'a' == 'A'
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.