title: PHP Regex Get Text Between BBCode Tags
body: <p>I need help with the PHP code for the following:</p>
  
  <p>Get the text between each occurrence the BBCode tags [code] and [/code] in a given string so I can then replace the spaces ' ' with the nbsp character.</p>
  
  <p>Long story short, I can't use CSS or DOM to do this, I need to do this on the server.</p>
  
  <p>#[code](.*?)[/code]# seems to only work if there are no breaks (or newlines) between the starting and ending tags.... :(</p>