fork(1) download
  1. x <- c("Total Assets in th USD", "Equity in mil EUR", "Number of Branches")
  2. currencies <- c("USD", "EUR", "GBP")
  3.  
  4. regex <- paste0("\\b(",
  5. paste(currencies, collapse = "|"),
  6. ")\\b")
  7. # results in
  8. # "\b(USD|EUR|GBP)\b"
  9.  
  10. regmatches(x, gregexpr(regex, x))
Success #stdin #stdout 0.22s 60768KB
stdin
Standard input is empty
stdout
[[1]]
[1] "USD"

[[2]]
[1] "EUR"

[[3]]
character(0)