Brooks Ryba
Brooks Ryba

Reputation: 71

Search Twitter with a Regular Expression

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}/

Upvotes: 4

Views: 3780

Answers (2)

The Guy
The Guy

Reputation: 137

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.

Upvotes: 4

onteria_
onteria_

Reputation: 70577

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.

Upvotes: 6

Related Questions