utils_regmatches_if_not_empty: Conditionally amend character string vector.

Description Usage Arguments Value Examples

Description

Searches for non-empty string 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.

Usage

1
2
3
4
5
6
utils_regmatches_if_not_empty(
  string_filter,
  string_search,
  regex_search,
  ignore_case_search
)

Arguments

string_filter

A Character string vector.

string_search

Alternative character string to search into for the pattern provided in regex_search below

regex_search

Alternative pattern provided as a character string regex to look for in the alternative character string provided in string_search above.

ignore_case_search

Boolean specifying whether case should be ignored (TRUE) or not (FALSE) in search for regex_search in string_search.

Value

A list of character string vectors.

Examples

1
2
3
4
5
6
7
## Not run: 
  utils_regmatches_if_not_empty(
    c("glasgow-entrepreneurs", "", "aberdeen-entrepreneurs"),
    "edinburgh-entrepreneurs" , "^edinburgh", TRUE
  )

## End(Not run)

podcleaner documentation built on Jan. 12, 2022, 1:06 a.m.