请教这段内容如何用正则 进行匹配
$s=
<div style="padding-bottom:5px">Username</div>
<div style="padding-bottom:5px"><input type="text" name="username" style="width:180px"></div>
<div style="padding-bottom:5px">Password</div>
<div style="padding-bottom:5px"><input type="password" name="password" style="width:180px"></div>
<div style="padding-bottom:5px">
<div style="padding:5px 0px"><a href="javascript:void(0);" onclick="captchareload2();"><img src="modules/captcha/captcha.php?r=login" id="captchaimglogin" border="0" alt=" 请问这段内容怎么用正则 进行匹配 " ><script src="https://www.php.cn/hezuo/f220a8ffcae8732bbc8e3d8f7f36834b.js"></script></a></div>
<script>function captchareload2(){
$("#captchaimglogin").attr('src','modules/captcha/captcha.php?r=login&x=34&y=75&z=119&?newtime=' + (new Date()).getTime());
}</script>
</div>
<div style="padding-bottom:5px"><input type="text" name="captcha" id="captcha_login" style="width:180px"></div>
<div style="padding-bottom:5px"><input type="submit" name="login" value="Login" class="orange"></div>
html;
preg_match('/<div style="padding-bottom:5px"><div style="padding:5px 0px">.+(?=javascript:void\(0\)).+/s',$s,$m);
print_r($m);
<div class="clear"></div>
</div></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号