Get & store digits from string <p>I have a string of values like this:</p> <pre><code>=&gt; "[\"3\", \"4\", \"60\", \"71\", \"49\", \"62\", \"9\", \"14\", \"17\", \"63\"]" </code></pre> <p>I want to put each value in an array so I can use each do. So something like this:</p> <pre><code>@numbers =&gt;["72", "58", "49", "62", "9", "13", "17", "63"] </code></pre> <p>This is the code I want to use once the string is a usable array:</p> <pre><code>@numbers.each do |n| @answers &lt;&lt; Answer.find(n) end </code></pre> <p>I have tried using <code>split()</code> but the characters are not balanced on each side of the number. I also was trying to use a regex <code>split(/\D/)</code> but I think I am just getting worse ideas.</p> <p>The controller:</p> <pre><code>@scores = [] @each_answer = [] @score.answer_ids.split('/').each do |a| @each_answer &lt;&lt; Answer.find(a).id end </code></pre> <p>Where <code>@score.answer_ids</code> is:</p> <pre><code>=&gt; "[\"3\", \"4\", \"60\", \"71\", \"49\", \"62\", \"9\", \"14\", \"17\", \"63\"]" </code></pre>