ここに私が得るエラーがありますpreg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 77
そして、ここにビジネスがあります:
$youtubeIdPattern = "#(?<=(?:v|i)=)[a-zA-Z0-9-]+(?=&)|(?<=(?:v|i)\/)[^&\n]+|(?<=embed\/)[^\"&\n]+|(?<=??(?:v|i)=)[^&\n]+|(?<=youtu.be\/)[^&\n]+#";
$youtubeIdMatch = array();
if ( isset( $regexMatch[0] ) && $regexMatch[0] != "" ) :
preg_match($youtubeIdPattern,$regexMatch[0],$youtubeIdMatch);
endif;
参考までに、YouTube の URL からビデオ ID だけを取得しようとしています。