fork download
  1. companies <- data.frame(Name=c("Company A Inc (COMPA)","Company B (BEELINE)", "Company C Inc. (Coco)", "Company D Inc.", "Company E"))
  2. gsub("\\s*(\\([^()]*(?:(?1)[^()]*)*\\))", "", companies$Name, perl=TRUE)
Success #stdin #stdout 0.24s 39740KB
stdin
Standard input is empty
stdout
[1] "Company A Inc"  "Company B"      "Company C Inc." "Company D Inc."
[5] "Company E"