fork download
  1. x <- "[abc], [def] abc,+def abc,def"
  2. reg <- "][^[]*\\[(*SKIP)(*F)|,(?!\\+)"
  3. strsplit(x, reg, perl=TRUE)
  4. gsub(reg, "@", x, perl=TRUE)
Success #stdin #stdout 0.18s 183680KB
stdin
Standard input is empty
stdout
[[1]]
[1] "[abc], [def] abc,+def abc" "def"                      

[1] "[abc], [def] abc,+def abc@def"