s <- "(((K05708+K05709+K05710+K00529) K05711),K05712) K05713 K05714 K02554"strsplit(s, "(\\((?:[^()]++|(?1))*\\))(*SKIP)(*F)| ", perl=TRUE)
Standard input is empty
[[1]] [1] "(((K05708+K05709+K05710+K00529) K05711),K05712)" [2] "K05713" [3] "K05714" [4] "K02554"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!