通过 preg_match 传递带有元字符的变量?
我已经尝试了三个小时来传递这些变量(字符串) 通过 preg_match.我已经尝试了一切。 preg_quote 只会让他们变得更糟。
".html">";
"</a> (<a";
你会认为
"/.html/">"; and
"</a> /(<a"; would work but no
I've been trying for three hours to pass these variables(strings)
through preg_match. i have tried everything. preg_quote just messes them up worse.
".html">";
"</a> (<a";
you'd think that
"/.html/">"; and
"</a> /(<a"; would work but no
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
preg_quote()
,并设置第二个参数是你的正则表达式分隔符。Use
preg_quote()
, and set the second parameter to be your regex delimiter.