正則表達式在這裏。尋找一些C#正則表達式代碼來「語法高亮」Twitter文本。因此,考慮這個鳴叫:用正則表達式分析tweet文本
@taglius here's some tweet text that shouldn't be highlighted #tagtestpix http://aurl.jpg
我想找到的用戶提到(@),主題標籤(#)和網址(http://),並添加相應的HTML顏色突出顯示這些元素。類似於
<font color=red>@taglius</font> here's some tweet text that shouldn't be highlighted <font color=blue>#tagtestpix</font> <font color=yellow>http://aurl.jpg</font>
這不是我將要使用的確切html,但我認爲你明白了。
注意使Regex'es靜態成員。我已經接受並接受了我的舊問題的答案。感謝您的幫助。 – taglius 2011-12-13 19:49:04
謝謝,先生。社區受益於你的慷慨=) – jadarnel27 2011-12-13 19:52:04