刪除 ahref 字串之間的“example”

刪除 ahref 字串之間的“example”

你們能幫我解決這個問題嗎?

我知道存在一個 ctrl + alt 然後選擇,但我想使用類似的程式碼(例如:(<a) "[0-9a-f-]”)*

<a "Testt 22" href="https://test.com" data-href="https://test.com/">

to 

<a href="https://test.com" data-href="https://test.com/">

因為我只是簡化了資訊例子

答案1

  • Ctrl+H
  • 找什麼:<a \K.*?(?=href=)
  • 用。LEAVE EMPTY
  • 查看 環繞
  • 查看 正規表示式
  • 取消選取 . matches newline
  • Replace all

解釋:

<a              # <a and a space
\K              # forget it
.*?             # 0 or more any character, not greedy
(?=href=)       # positive lookahead, make sure we have href= after

截圖(之前):

在此輸入影像描述

截圖(之後):

在此輸入影像描述

相關內容