Split by top level comma

monkyyy crazymonkyyy at gmail.com
Tue Sep 24 13:57:56 UTC 2024


I *strongly* believe the answer is not reasonable using phoboes 
tools; but Im going to leave it as an open question before I get 
started on something from scratch.

Given well compliant phoboes-style ranges and a `ref string or 
retro!string` that starts with '(',')','[',']','{','}', modify 
that string so that you a) find the matching pair, b) return a 
list of indexs for where the top level commas are

"(foo([1,2]),bar!"\","(((())))foobar" => 
"(foo([1,2]),bar!"\","(((())))",[12]
retro("abc[1,2,3,4,"❤️❤️❤️❤️","\","]") => "[1,2,3,4,"❤️❤️❤️❤️","\","]", 
[2,4,6,8,35]


More information about the Digitalmars-d-learn mailing list