/* YouTube code */
$pattern[]="/<object width=\"[0-9]+\" height=\"[0-9]+\"><param name=\"movie\" value=\"http[s]*:\/\/www\.youtube\.com\/v\/([a-zA-Z0-9-_]+)&fs=1\"><\/param><param name=\"wmode\" value=\"transparent\"><\/param><param name=\"allowFullScreen\" value=\"true\"><\/param><embed src=\"http[s]*:\/\/www\.youtube\.com\/v\/([a-zA-Z0-9-_]+)&fs=1\" type=\"application\/x-shockwave-flash\" wmode=\"transparent\" width=\"[0-9]+\" height=\"[0-9]+\" allowfullscreen=\"true\"><\/embed><\/object>/i";
$replacement[]="[youtube=https://www.youtube.com/watch?v=\\1]";

$pattern[]="/<div class=\"ytc\"><iframe width=\"([0-9]+)\" height=\"([0-9]+)\" src=\"http[s]*:\/\/[w.]*youtube\.com\/embed\/([a-zA-Z0-9-_]+)([a-z0-9?=]*)\" frameborder=\"0\" (allow=\"([a-z-; ]+)\")? allowfullscreen><\/iframe><\/div>/i";
$replacement[]="[youtube\\1x\\2=https://youtu.be/\\3\\4]";

$pattern[]="/<iframe width=\"([0-9]+)\" height=\"([0-9]+)\" src=\"http[s]*:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9-_]+)([a-z0-9?=]*)\" frameborder=\"0\" (allow=\"([a-z-; ]+)\" )?allowfullscreen><\/iframe>/i";
$replacement[]="[youtube\\1x\\2=https://youtu.be/\\3\\4]";
/* --YouTube code */