gpt4 book ai didi

php - 在 PHP 中从 Twitter 提要获取所有哈希标签的最快方法是什么?

转载 作者:可可西里 更新时间:2023-10-31 22:58:23 25 4
gpt4 key购买 nike

这可能是一个简单的问题,但在文本中找到特定单词的最快(执行时间更短)是什么。

Example: search for all words with hash tag in beginning  of the word

Input: #google bought #zagat today
Output: google zagat

最佳答案

/#[^ ]+/

您可以使用preg_match_all

preg_match_all ( '/#[^ ]+/' , $subject, $matches );

关于php - 在 PHP 中从 Twitter 提要获取所有哈希标签的最快方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7352221/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com