title: preg_match_all getting weird
body: <p>I have some text that's wrapped in <code>[quote][/quote]</code> and I'm trying to match all text before those tags, everything in between those tags, and everything after those tags. The catch is that there may be multiple occurrences of them, but not within each other.</p>
  
  <p>The reason for me doing this is because I want to run a filter on all the text outside of those tags whether there's multiple occurrences or not.</p>
  
  <p>This is what I'm starting to work with:</p>
  
  <pre><code>preg_match_all("/(^.*)\[quote\](.*?)\[\/quote\](.*)/si", $reply['msg'], $getthequotes);
  </code></pre>
  
  <p>Here's the output:</p>
  
  <pre class="lang-none prettyprint-override"><code>Array
  (
  [0] =&gt; Array
      (
          [0] =&gt; putting some stuff before the quote
  [quote][b]Logan said[/b][br]testing this youtube link http://www.youtube.com/watch?v=8UVNT4wvIGY&amp;feature=g-music&amp;context=G2db8219YMAAAAAAAAAA[br][br]did it work?[br][br][i]04/04/12 23:48:46: Edited by Logan(2)[/i][br][br][i]04/04/12 23:55:44: Edited by Logan(2)[/i][/quote]
  
  yep
  
  http://www.youtube.com/watch?v=8UVNT4wvIGY&amp;feature=g-music&amp;context=G2db8219YMAAAAAAAAAA
  
  adding a quote
  
  [quote][b]Logan said[/b][br]This is the start of the second quote http://www.youtube.com/watch?v=8UVNT4wvIGY&amp;feature=g-music&amp;context=G2db8219YMAAAAAAAAAA[br][br]did it work?[br][br][i]04/04/12 23:48:46: Edited by Logan(2)[/i][br][br][i]04/04/12 23:55:44: Edited by Logan(2)[/i][/quote]
  
  [i]04/07/12 20:18:07: Edited by Logan(2)[/i]
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; putting some stuff before the quote
  
  [quote][b]Logan said[/b][br]testing this youtube link http://www.youtube.com/watch?v=8UVNT4wvIGY&amp;feature=g-music&amp;context=G2db8219YMAAAAAAAAAA[br][br]did it work?[br][br][i]04/04/12 23:48:46: Edited by Logan(2)[/i][br][br][i]04/04/12 23:55:44: Edited by Logan(2)[/i][/quote]
  
  yep
  
  http://www.youtube.com/watch?v=8UVNT4wvIGY&amp;feature=g-music&amp;context=G2db8219YMAAAAAAAAAA
  
  adding a quote
  
  
      )
  
  [2] =&gt; Array
      (
          [0] =&gt; [b]Logan said[/b][br]This is the start of the second quote http://www.youtube.com/watch?v=8UVNT4wvIGY&amp;feature=g-music&amp;context=G2db8219YMAAAAAAAAAA[br][br]did it work?[br][br][i]04/04/12 23:48:46: Edited by Logan(2)[/i][br][br][i]04/04/12 23:55:44: Edited by Logan(2)[/i]
      )
  
  [3] =&gt; Array
      (
          [0] =&gt; 
  
  [i]04/07/12 20:18:07: Edited by Logan(2)[/i]
      )
  
  )
  </code></pre>
  
  <p>As you can see it's not getting the desired output. Any help would be appreciated. </p>