title: Ruby: Parsing a string representation of nested arrays into an Array?
body: <p>Let's say I had the string</p>
  
  <pre><code>"[1,2,[3,4,[5,6]],7]"
  </code></pre>
  
  <p>How would I parse that into the array</p>
  
  <pre><code>[1,2,[3,4,[5,6]],7]
  </code></pre>
  
  <p>?</p>
  
  <p>Nesting structures and patterns are completely arbitrary in my usage case.</p>
  
  <p>My current ad-hoc solution involves adding a space after every period and using <code>YAML.load</code>, but I'd like to have a cleaner one if possible.</p>
  
  <p>(One that does not require external libraries if possible)</p>