codice:
$str = 'file.flv';

preg_match('#<a href="(.*?\.(?:flv|mp4))"#', $str, $match);

if ( $match ) {
    echo "<pippo>{$match[1]}</pippo>";
}