问题
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