<?php
$string='[b]Write poems for you[/b]
[i]Do impossible things for you[/i]
$pattern=array(
'/\[b\](.*)\[\/b\]/i',
'/\[i\]( .*)\[\/i\]/iU',
);
$replace=array(
'<b>\\1</b> ;<br />',
'<i>\\1</i><br />',
);
$ ubb=preg_replace($pattern,$replace,$string);
echo $ubb;
Why does \\1 inherit (.*) instead of replacing it? ? ?