I’m trying to integrate the PHP script AutoEmbed, however I noticed that the regular expression for MetaCafe is not up-to-date. Can I get some help please.
array(
'title' => 'MetaCafe',
'website' => 'http://www.metacafe.com',
'url-match' => 'http://(?:www\.)?metacafe\.com/(?:watch|fplayer)/(\w{1,10})/',
'embed-src' => 'http://www.metacafe.com/fplayer/$2/metacafe.swf',
'embed-width' => '400',
'embed-height' => '345',
),
The regular expression works fine for this:
http://www.metacafe.com/watch/8145782/inbred_official_trailer_2012/
But not for this:
http://www.metacafe.com/watch/mv-Qp52/who_is_he/
I think it may be to do with the ‘mv-Qp52’ part containing a dash?
Yes, the dash is not included in
\w.You can manually fix the regex by adding the dash to the allowed characters set:
http://(?:www\.)?metacafe\.com/(?:watch|fplayer)/([\w\-]{1,10})/