文本清潔制我有一個微博的文件,它包含了這樣的臺詞:用記事本++
RichardJ0nes -- Should I upgrade to an iPhone 5? Decisions, decisions!
AnthonyMOliva -- @AnthonyMOliva AT&T offering iPhone 5 refurbished starting at $99: Two months after making its debut, refur... http://t.co/IsPDzIrD #BBC
mittrashi -- RT @timesofindia: Apple iPhone 5S, iPad 5 already in the works? - The Times of India http://t.co/s782BHp5
我想清理這個文件。 首先我想清除用戶名(例如:RichardJ0nes - 或@AnthonyMOliva),其次我想清除鏈接(例如http://t.co/s782BHp5)。
它應該是這樣的:
Should I upgrade to an iPhone 5? Decisions, decisions!
AT&T offering iPhone 5 refurbished starting at $99: Two months after making its debut, refur...
Apple iPhone 5S, iPad 5 already in the works? - The Times of India
我嘗試做與記事本正則表達式++的東西,但我無法清除文本
我嘗試先刪除用戶名與
找到.*\(--\)
更換:\1
但它不能在記事本++。我該怎麼做,請給我一個想法?
也許在'[@#]'之前加上'(?:RT)?'以匹配它。 – garyh
@garyh - 我相信OP想要保持這一點,即使他/她的問題顯示沒有。否則,關於搜索/替換規則的問題還不清楚...... –
我同意,OP並不清楚,因爲他們沒有明確聲明刪除「RT」,但是它並未出現在已清除的文本中。只是增加價值! – garyh