2017-07-28 77 views
1

人開始都充滿鏈接...記事本+ +正則表達式獲取與字符串在HTML

我有一個大的HTML,我想利用與

https://exampledomain.com/category/」開頭的所有鏈接,並刪除休息,HTML有像通「https://exampledomain.com/edit/ ...」「https://exampledomain.com/view/ ...」,有吊牌,文字,我要刪除所有,但沒有「https://exampledomain.com/category/.../enter image description here

最後的結果一定是這樣的:

https://www.exampledomain/category/presents/ 
https://www.exampledomain/category/books/ 
https://www.exampledomain/category/clothes/ 
https://www.exampledomain/category/bags/ 

任何想法? 謝謝! :)

+2

快速的方法:更換'A HREF =「'用一個新行則行(TextFX) –

+0

你可以發佈文本例如排序?轉錄該圖像將是一件麻煩事。 – chris85

+0

謝謝亞歷克斯,你的想法救了我! :D – Emanuel

回答

2

亞歷克斯提出的,我用搜索和替換單獨sepparate在一條線上的鏈接(通過擴展\ N)...

搜索(https://www.exampledomain/category/[^"]*) 匹配所有鏈接,直到( 「)(HREF =結束」 URL 「)
替換\n\n\1\n\n

當其完成,我使用記事本++」 CTFL + F>標記「以選擇包含

所有行10
https://www.exampledomain/category/ 

然後,除去沒有標線......使用菜單>搜索>標記>刪除沒有選擇的行...

謝謝! :d

+0

如何去除尾部的殘留物? – sln

1

您可以使用此:

線上纏繞::是
查找:.*?"(https://www.exampledomain/category/.*?)"|.*
替換:\1\n
正則表達式:
.匹配換行符:

點擊全部替換

+0

您能否告訴我這是否適合您? – trincot