I have the following regexp, that removes BB-tags from string. But I need to remove only empty BB-tags. Can you modify my regular expression?
$message = preg_replace("#\[\/?[a-z0-9\*\+\-]+(?:=(?:".*"|[^\]]*))?(?::[a-z])?(\:$uid)\]#", '', $message);
Thank you in advance.
$str = '[a]asd[/a] [b][/b][c][/c]';
var_dump(preg_replace('~\[([^\]]+)\]\[/\\1\]~', '', $str));