title: Complex Regex getting value from string
body: <p>Here are some input samples:</p>
  
  <p>1, 2, 3<br/>
  'a', 'b', &nbsp;&nbsp;&nbsp;'c'<br/>
  'a','b','c'<br/>
  1, 'a', 'b'<br/></p>
  
  <p>Strings have single quotes around them, number don't. In strings, double single quote '' (that's two times ') is the escape character for single quote '. The following also also valid input.
  <br/><br/>
  'this''is''one string', 1, 2<br/>
  '''this'' is a weird one', 1, 2<br/>
  '''''''', 1, 2<br/></p>
  
  <p>after playing around for a looong time, I ended up with something like:</p>
  
  <pre><code>^(\\d*|(?:(?:')([a-zA-Z0-9]*)(?:')))(?:(?:, *)(\\d*|(?:(?:')([a-zA-Z0-9]*)(?:'))))*$
  </code></pre>
  
  <p>which totally doesn't work and is not complete :)</p>
  
  <p>Using Java matcher/group an example would be:<br/>
  input: '''la''la', 1,3<br/>
  matched groups:</p>
  
  <ul>
  <li>'la'la</li>
  <li>1</li>
  <li>2</li>
  </ul>
  
  <p>Note that the output string doesn't have single quotes around it but just the escaped quotes from the input.</p>
  
  <p>any Regex gurus out there? thanks<br/>
  PS: I'll let you know if I ever figure it out myself, still trying</p>