包含反斜杠的正则表达式模式会导致 preg_replace() 失败
据我所知,我已经完全按照规定做了,但 PCRE 对我来说完全没有意义,所以我要问你这段代码有什么问题,为什么它说:
偏移量 10 英寸处的字符类缺少终止符 ]
$UrlTeams = preg_replace(
array(
"/[\/\\\40][\\]?/",
"/[\.%]/",
"/\&/"
),
array(
"/\-/",
"",
"\&\;"
),
$UrlTeams
);
So as far as I know, I have done this exactly as prescribed I should do, but PCRE makes absolutely no sense to me at all, so I am going to ask you what is wrong with this code and why does it say:
missing terminating ] for character class at offset 10 in
$UrlTeams = preg_replace(
array(
"/[\/\\\40][\\]?/",
"/[\.%]/",
"/\&/"
),
array(
"/\-/",
"",
"\&\;"
),
$UrlTeams
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
Try: