Description Usage Arguments Details See Also Examples
Get elements matching (str_grep
) or not matching (str_grep
)
a pattern.
1 2 3 |
string |
string ; Input vector. Either a character vector, or something coercible to one. |
pattern |
match pattern; The default interpretation is a regular expression, as described in stringi-search-regex. Control options with regex(). Match a fixed string (i.e. by comparing only bytes), using fixed(x). This is fast, but approximate. Generally, for matching human text, you'll want coll(x) which respects character matching rules for the specified locale.Match character, word, line and sentence boundaries with boundary(). An empty pattern, "", is equivalent to boundary("character"). |
str_grep
returnes elements matching a pattern. Shorthand for
string[ str_detect(string,pattern) ]
str_grepv
returnes elements that do not matching a pattern. The 'v'
derived from the unix flag -v
from the linux grep
command. It
is mostly as a convenient way to avoid negative lookaheads.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.