Thanks for your attention.
One more proposition: move function arguments out of man tag. Like this:
$text=preg_replace("!(\\([^)]*\\)) *(\\[/man\\])!i","\\2\\1",$text);
You can use function [man]join($glue,$array)[/man].
converted to
You can use function [man]join/man.
... and one more question: double backslash in my example code converted to single by site. Is this right? I think this is mistake.