preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", “ext/plain; charset=utf-8”)
错误
preg_match(): compilation failed: invalid range in character class at offset 7
正则不熟 求救
echo preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", "ext/plain; charset=utf-8"); //1 为什么你的php会报错?我用你的正则显示的是匹配成功啊。。。
<?phpheader('content-type:text/html;charset=utf-8');//$res = preg_match("/^([\.-\w]+)\/([\.-\w]+);\s(\S)*$/i", 'ext/plain; charset=utf-8');$res = preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", "ext/plain; charset=utf-8");if($res){ echo "匹配!";}else{ echo "匹配失败!";}?>估计是服务器问题。debian线上正常。本地MAC和windows都有问题。无奈只能换个方法写
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号