<?php
$url = "http://example.com/2012/3/1/test.html";
$pattern = '/^https?:\/\/[a-z]+\/[0-9]{4}\/[0-9]{1,2}\/[0-9]{1,2}\/[a-z]+\.html$/';
$ismatch = preg_match($pattern, $url);
echo $ismatch; // 1 if true, 0 if false
?>
参考http://www.regular-expressions.info/php.html