title: Match all square brackets with preg_match_all`
body: <p>I'm trying to match multiple square bracket tags in a string to extract them from the string. </p>
  
  <p>For example:</p>
  
  <pre><code>$string = 'Request: [CODE]sksdjdiwjwdwdkw[/CODE] Response: [CODE]sksdjdiwjwdwdkw[/CODE]';
  </code></pre>
  
  <p><code>preg_match_all('/\[CODE\](.*)\[\/CODE\]/',$string)</code> matches everything between the first <code>[CODE]</code> and last <code>[/CODE]</code>. </p>
  
  <p>Does anyone have a idea on how the expression are suppost to look like?</p>