Questions tagged «preg-match-all»

1
在PHP中使用preg_match时,“在...中存在未知修饰符'g'”?
这是我要使用的正则表达式: /^(\w|\.|-)+?@(\w|-)+?\.\w{2,4}($|\.\w{2,4})$/gim 我在此网站上找到了它,当我在那里尝试时,它的效果很好。但是,一旦将其放入代码中,就会收到以下消息: Warning: preg_match() [function.preg-match]: Unknown modifier 'g' in C:\xampp\htdocs\swebook\includes\classes.php on line 22 任何人都可以解释出什么问题了,为什么它可以在该网站上运行,而不是在我的代码中?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.