regex-helpers {roxytypes} | R Documentation |
A half-baked extract method
Description
A half-baked extract method
Usage
re_extract(pattern, replace, x)
extract_backticked(x)
extract_quoted(x)
is_backticked(x)
is_bracketed(x)
Arguments
pattern |
character string containing a regular expression
(or character string for |
Value
(character[1]
) The substituted string if a replacement is made, or NULL
otherwise.
Functions
-
extract_backticked()
: Extract contents of a backtick-enclosed string -
extract_quoted()
: Extract contents of a quoted (single or double) string -
is_backticked()
: Extract contents of a backtick-enclosed string -
is_bracketed()
: Test whether contents are enclosed in brackets
Note
This implementation is considered half-baked because there's no check for whether a replacement is made that results in the same string. This case will be interpreted the same as if there was no match.