Let's say I had the string
"[1,2,[3,4,[5,6]],7]"
How would I parse that into the array
[1,2,[3,4,[5,6]],7]
?
Nesting structures and patterns are completely arbitrary in my usage case.
My current ad-hoc solution involves adding a space after every period and using YAML.load
, but I'd like to have a cleaner one if possible.
(One that does not require external libraries if possible)
See Question&Answers more detail:os