I'm trying to do a preg_replace to convert come bbcode. Basically, this
[QUOTE=ksiva]blahblah blah[/QUOTE]
Needs to look like this
<div class=quote-msg"><div class="quote-author"><em>ksiva</em></div>blahblah blah</div>
I tried this preg replace, but it's not working. What am I doing wrong?
$pattern = '#\[QUOTE=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/QUOTE\]#s';
$replace = '<div class="quote-msg"><div class="quote-author><em>$1</em></div>$2</div>';
$text = PREG_REPLACE($pattern, $replace, $text);
[QUOTE=name]part look like? Could it be just[QUOTE]or does it have to have a name? What will the names look like?<div class="quote-author- fix that and you should be good to go.