title: preg_replace expression and wrapping expression
body: <p>So I've put together this BB code thing that will convert certain tags to html tags later on. It all works great, except when it comes to a h tag and align=center/left/right/justify tag (which translates to <code>&lt;h1&gt;</code> and <code>&lt;p style="text-align=center/left/right/justify"</code>). It would seem like it interferes with the script due to the number 1 (number 1 is refering to the text). How would I go about to solve this problem? I'd like to keep h1 and such, but it would be wonderful if you could center align it yet keep it big  text.</p>
  
  <pre><code>function parseBBCode($sound_edit_long_desc){
  $original = array(
  '/\[b\](.*?)\[\/b\]/',
  '/\[h\](.*?)\[\/h\]/',
  '/\[i\](.*?)\[\/i\]/',
  '/\[u\](.*?)\[\/u\]/',
  '/\[s\](.*?)\[\/s\]/',
  '/\[img\](.*?)\[\/img\]/',
  '/\[url\=(.*?)\](.*?)\[\/url\]/',
  '/\[code\](.*?)\[\/code\]/',
  '/\[align=left\](.*?)\[\/align\]/',
  '/\[align=right\](.*?)\[\/align\]/',
  '/\[align=center\](.*?)\[\/align\]/',
  '/\[align=justify\](.*?)\[\/align\]/'
  );
  $replace = array(
  '&lt;strong&gt;\\1&lt;/strong&gt;',
  '&lt;h1&gt;\\1&lt;/h1&gt;',
  '&lt;em&gt;\\1&lt;/em&gt;',
  '&lt;u&gt;\\1&lt;/u&gt;',
  '&lt;strike&gt;\\1&lt;/strike&gt;',
  '&lt;img src="\\1"&gt;',
  '&lt;a href="\\1" class="alink" target="_blank"&gt;\\2&lt;/a&gt;',
  '&lt;code&gt;\\1&lt;/code&gt;',
  '&lt;p class="post" style="text-align: left;"&gt;\\1&lt;/p&gt;',
  '&lt;p class="post" style="text-align: right;"&gt;\\1&lt;/p&gt;',
  '&lt;p class="post" style="text-align: center;"&gt;\\1&lt;/p&gt;',
  '&lt;p class="post" style="text-align: justify;"&gt;\\1&lt;/p&gt;'
  );
  $new = preg_replace($original, $replace, $sound_edit_long_desc);
   return nl2br($new);
  }
  </code></pre>