JS regex.exec() returning first find
<p>I am trying to learn how to break up this string:</p>

<pre><code>var str = 'red','blue','gree'
</code></pre>

<p>I have this working code:</p>

<pre><code>var clean = str.replace(/\'/g, "");
var elements = clean.split(',');
</code></pre>

<p>which produces array <code>["red","blue","green"]</code> which is what i want however. id like to learn how to do this using regex.exec() method.</p>

<p>here is what i got:</p>

<pre><code>var patt = /([^']+)/g;
var elem= patt.exec(str); 
</code></pre>

<p>but this returns array <code>["red","red"]</code></p>

<p>any ideas?</p>
