x <- "A(B)C"
library(stringr)
str_extract_all(x, "\\([^()]*\\)|[^()]+")