utils_regmatches_if_found {podcleaner} | R Documentation |
Conditionally amend character string vector.
Description
Searches for specified pattern in provided character string vector. If found, searches for alternative pattern in an alternative character string and returns any match or an empty string if none. If original pattern not found, returns the default character string provided.
Usage
utils_regmatches_if_found(
string_filter,
regex_filter,
string_search,
regex_search,
default,
ignore_case_filter,
ignore_case_match,
not
)
Arguments
string_filter |
Character string vector to search into for the pattern
provided in |
regex_filter |
Pattern to look for provided as a character string regex. |
string_search |
Alternative character string to search into for the
pattern provided in |
regex_search |
Alternative pattern provided as a character string regex
to look for in the alternative character string provided in |
default |
Character string returned if pattern provided in |
ignore_case_filter |
Boolean specifying whether case should be ignored
( |
ignore_case_match |
Boolean specifying whether case should be ignored
( |
not |
Boolean specifying whether to negate the |
Value
A character string vector.
Examples
## Not run:
utils_regmatches_if_found(
c("glasgow-entrepreneurs", "aberdeen-entrepreneurs"), "^glasgow",
"edinburgh-entrepreneurs", "^.+(?=-)", "merchant", TRUE, TRUE, FALSE
)
## End(Not run)