title: Regular expression to extract annotation parameter
body: <p>i want to extract parameter like exist in annotation</p>
  
  <p>i have done this far</p>
  
  <pre><code>$str = "(action=bla,arg=2,test=15,op)";
  preg_match_all('/([^\(,]+)=([^,\)]*)/', $str, $m);
  
  $data = array_combine($m[1], $m[2]);
  var_dump($data);
  </code></pre>
  
  <p>this gives following out put</p>
  
  <pre><code>array (size=3)
    'action' =&gt; string 'bla' (length=3)
    'arg' =&gt; string '2' (length=1)
    'test' =&gt; string '15' (length=2)
  </code></pre>
  
  <p>this is ignoring op (but i want it having null or empty value)</p>
  
  <p>but i want to improve this so it can extract these also</p>
  
  <ul>
  <li>(action='val',abc) in this case value inside single quote will assign to action</li>
  <li>(action="val",abc) same as above but it also extract value between double quote</li>
  <li>(action=[123,11,23]) now action action will contain array 123,11,23 (this also need to extract with or without quotation)</li>
  </ul>
  
  <p>i don't want complete solution(if you can do it then most welcome)  but  i need at least first two  </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>(edit as per disucssion with r3mus)
  output should be like</p>
  
  <pre><code>array (size=3)
    'action' =&gt; string 'bla' (length=3)
    'arg' =&gt; string '2' (length=1)
    'test' =&gt; string '15' (length=2)
    'op' =&gt; NULL
  </code></pre>