_Actual_ Twitter format for hashtags? Not your regex, not his code— the actual one?

前端 未结 6 612
野趣味
野趣味 2021-02-07 14:27

Update: Use Twitter\'s Entities if you can- they figured it out for you as well as other items. My case is that I just have the tweet without entities and all the extra metadat

6条回答
  •  春和景丽
    2021-02-07 14:47

    Based on how the official Twitter client for Mac highlights hashtags, I suspect the rule is any sequence of contiguous letters, numbers, or underlines following a hash. In other words, it's as simple as the regex /#\w+/ (assuming a unicode-aware regex engine).

提交回复
热议问题