$bbcode = array('#\[sup\](.*?)\[/sup\]#si' => '\\1');
$text = preg_replace(array_keys($bbcode), array_values($bbcode), $text);
Don't use regexps for parsing. Ever.
Read this: http://kore-nordmann.de/blog/do_NOT_parse_using_regexp.html
(Never mind that bbcode is phenomenally retarded in the first place)
Well wtf do I use?
I'm going to suggest the obvious: search for php bbcode. If you were using perl, you'd search perl bbcode instead; if you wanted to implement html, you'd search languageX html.
use str_replace() and move on with your life.
>>5
Way to entirely miss the point.
I was wrong to try to talk to PHP programmers. I'll be leaving now for smarter threads.