That would match whole following..
Code:
[youtube=425,350]NN7XXCDqzVg[/video]
However, I need to grab value which is in bold and then
Put it in :
[code][video]http://www.youtube.com/watch?v=
NN7XXCDqzVg[/video]
I can do following:
PHP Code:
$subject = '[youtube=425,350]NN7XXCDqzVg[/youtube]';
$find = '/\[youtube=(\d*){3},(\d*){3}\][a-zA-Z-]*\[/youtube]/im';
$replace = '[video]http://www.youtube.com/watch?v=\3[/video]';
$result = preg_replace($find, $replace , $subject);
Now kindly advice if that is ok as I am still not confident in regex and had hardly used backreference before.