<?php
$re = '/{youtube}(.*){\/youtube}/m';
$str="Life is good
{youtube}NgBZrRCPCH8{/youtube}
Fun is great!
{youtube}joRCPCH8{/youtube}
Earth is round and roll
{youtube}pwnkfH8{/youtube}";
preg_match_all($re, $str, $matches);
print_r($matches);
$re = '/([\w ]+)[^a-zA-Z {}]+(?!{)/m';
preg_match_all($re, $str, $matches);
print_r($matches);
Array
(
[0] => Array
(
[0] => {youtube}NgBZrRCPCH8{/youtube}
[1] => {youtube}joRCPCH8{/youtube}
[2] => {youtube}pwnkfH8{/youtube}
)
[1] => Array
(
[0] => NgBZrRCPCH8
[1] => joRCPCH8
[2] => pwnkfH8
)
)
Array
(
[0] => Array
(
[0] => Life is good
[1] => Fun is great!
[2] => Earth is round and roll
)
[1] => Array
(
[0] => Life is good
[1] => Fun is great
[2] => Earth is round and roll
)
)