Search Twitter with a Regular Expression

天大地大妈咪最大 提交于 2020-01-03 19:37:08

问题


Is there a way to search the twitter api using a regular expressions? The expression I need to match is for a stock name.

/\$[a-zA-Z]{1,5}/

回答1:


No, and as for the reason, you have to look at it from an architectural standpoint. Given the volume that Twitter has using the API, they would have to do the regex match against all possible tweets that are searchable. That is an insane amount of data processing.




回答2:


Well, it appears to have been possible in 2009: http://granades.com/2009/04/06/using-regular-expressions-to-match-twitter-users-and-hashtags/ Whether this is still implementable today is another question. At the machine level a search is a search is a search so I tend to disagree on principle with the other replier. Indeed, a good way for twitter to perform any search would be with an optimized regex engine.



来源:https://stackoverflow.com/questions/6144626/search-twitter-with-a-regular-expression

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!