正则表达式验证老是失败
<body><br /> <?php<br /> if(!empty($_POST[sub]))<br /> {<br /> <br /> if(ereg("\d{10}", $_POST[username]))<br /> <br /> {echo "验证通过。";}<br /> else<br /> {echo "验证失败";}<br /> }<br /> ?><br /> <form action="" method="post"><br /> 用户名<input type="text" name="username"><br><br /> <input type="submit" name="sub" value="提交"><br /> </form><br /> </body>