title: Making values in to objects using Regex (Java)
body: <p>I have some data that looks like this</p>
  
  <pre><code>myobject{keyone:"valueone",keytwo:"valuetwo",keythree:"valuethree"}
  myobject{keyone:"valueone",keytwo:"valuetwo",keythree:"valuethree"}
  myobject{keyone:"valueone",keytwo:"valuetwo",keythree:"valuethree"}
  </code></pre>
  
  <p>And I'm wondering what the best way to create a bunch of objects from it would be. I've written the following regex to extract all the values from a particular Key...</p>
  
  <pre><code>Pattern p_keyone            = Pattern.compile("keyone:\"(.+?)\"\\,"); 
  Matcher match_keyone    = p_keyone.matcher(string);
  
  while(match_keyone.find()) {      
      myobjects.add(new MyObject(match_keyone.group(1));
  }
  </code></pre>
  
  <p>Which gives me a bunch of objects with a single argument...</p>
  
  <p><code>myobjects.add(&lt;valueone&gt;);</code></p>
  
  <p>Is there a way I can execute a single regex query and create a bunch of objects with all the values as arguments in one go. Like this...</p>
  
  <pre><code>new MyObject( &lt;valueone&gt;, &lt;valuetwo&gt; , &lt;valuethree&gt; );
  </code></pre>
  
  <p>Thanks</p>