preg_match_all()[function.preg-match-all]:未知修饰符']' [英] preg_match_all() [function.preg-match-all]: Unknown modifier ']'

查看:94
本文介绍了preg_match_all()[function.preg-match-all]:未知修饰符']'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用了几种不同的模式,但是它们每个都会出现此错误-那么怎么了?

Using a few different patterns but they each come up with this error - so what's wrong?

我要诊断的最短的是:

$pattern = "<img([^>]*[^/])>";
preg_match_all($pattern, $subject, $matches);

谢谢

推荐答案

您缺少正则表达式定界符.试试:

You are lacking the regexp delimiters. Try:

$pattern = "#<img([^>]*[^/])>#i";

这篇关于preg_match_all()[function.preg-match-all]:未知修饰符']'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆