Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
查找@someone的PHP正则表达式_Php_Regex_Preg Match All - Fatal编程技术网

查找@someone的PHP正则表达式

查找@someone的PHP正则表达式,php,regex,preg-match-all,Php,Regex,Preg Match All,我需要一个PHP中的正则表达式,我可以将它插入preg_match_all中,然后查找@符号和任何字符数字或字母是否紧跟其后 所以如果我把 @帕特里克你好 如果我投入进去,它会变成现实 “我在购物中心见过她” 这将是错误的 感谢您至少后跟一个字母、数字或下划线的at符号: /@\w+/ 后接至少一个字母、数字或下划线的at符号: /@\w+/ Regex上的伟大网站: 就像我下面的人指出的那样 Regex上的伟大站点: 就像我下面的人指出的那样 你好!欢迎来到堆栈溢出!你好!欢迎来到堆栈溢出

我需要一个PHP中的正则表达式,我可以将它插入preg_match_all中,然后查找@符号和任何字符数字或字母是否紧跟其后

所以如果我把

@帕特里克你好

如果我投入进去,它会变成现实

“我在购物中心见过她”

这将是错误的


感谢您

至少后跟一个字母、数字或下划线的at符号:

/@\w+/

后接至少一个字母、数字或下划线的at符号:

/@\w+/
Regex上的伟大网站:

就像我下面的人指出的那样

Regex上的伟大站点:


就像我下面的人指出的那样

你好!欢迎来到堆栈溢出!你好!欢迎来到堆栈溢出!