【发布时间】:2021-11-20 13:39:57
【问题描述】:
我正在开发一个简单的提及系统和我的 PHP 脚本,我需要从较大的文本中提取 client:6,其中将出现一个或多个 @mention,如 @[John Doe (#6)](client:6)。
例如。 This is my text how do you like it @John and do you have any thoughts @Jane
在 php 中,字符串看起来像。
This is my text how do you like it @[John Doe (#6)](client:6) and do you have any thoughts @[Jane Doe (#7)](client:7)
我需要得到一个带有array('client:6','client:7')的数组
【问题讨论】:
-
regex101.com 上很多,但我不知道它是如何工作的,所以我只是在猜测,没有找到。