正则匹配指定长度的数字要怎么写?
$str=1234567890 <td>1234567890123</td> <td>0987654321</td> <td>3210987654321</td> <td>1324354657</td> <td>1324354657689</td> htm; preg_match('/(<td>[\d]{10})/',$str,$match); print_R ($match[1]); <br><font color="#e78608">------解决方案--------------------</font><br><dl class="code">PHP code<pre class="brush:php;toolbar:false"> <?php $str=<<<htm <td>1234567890
preg_match_all('/<td>(\d{10}\b)/',$str,$matchs); print_r ($matchs); <br><font color="#e78608">------解决方案--------------------</font><br>把函数改成 preg_match_all 就行了<br><br>preg_match_all('/(</td><td>[\d]{10})/',$str,$match);<br><br><div class="clear"></div> </td>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号