与其正则不如直接比较大小,速度更快$dateStr = date("Y-m");
if($dateStr <= "2099-12" && "2000-01" <= $dateStr){
echo true;
}