title: Split string into array by regular expression
body: <p>I need to create an array by searching a string for occurrences of '[' followed by 0 or more characters followed by ']'.</p>
  
  <p>My test string:</p>
  
  <pre><code>$string="[item 1] [2] [] [item3]";
  </code></pre>
  
  <p>All of the above must be matched.</p>
  
  <p>I think the regex to do so is </p>
  
  <pre><code>\[*\]
  </code></pre>
  
  <p>But how do I create an array out of the string? Do I use </p>
  
  <pre><code>preg_match_all("\[*\]", $string, $matches);
  </code></pre>
  
  <p>?</p>