使用notepad ++和正则表达式清理刮擦推文

时间:2012-07-15 16:13:56

标签: twitter tweets

我想知道如何从twitter中删除所有@mentions,#hashtags和URL http ....

我尝试过(并且失败)使用:

find all [@].* and replace with blank
find all [#].* and replace with blank
find all [http].* and replace with blank

等等......这只是完全删除了我刮掉的结果中的所有内容。

我是记事本的新手并试图整理所有信息。

提前致谢

1 个答案:

答案 0 :(得分:0)

你的表达太宽泛了。试试这个:

(@|#|http)\S+

或者,根据您的正则表达式风格,您可能需要写出\S(非空白)

(@|#|http)[^ ]+

当然,有了正则表达式,所有这一切都是为了确切地知道你想要什么,这通常是你在路上想到的。

相关问题