Regex to remove text between tags in Notepad++

后端 未结 1 1477
小蘑菇
小蘑菇 2021-02-01 09:57

I have a code like this

artifical-sweeteners-ruin-your-health

I want to change it to

         


        
1条回答
  •  遇见更好的自我
    2021-02-01 10:14

    Search for

    [^<>]+
    

    and replace all with

    
    

    This assumes that tags can't be nested (which makes the regex quite safe to use). If other tags may be present, then you need to search for

    (?i).*?
    

    instead (same replace string). However, this probably only works in the latest versions of Notepad++ which brought a major regex engine overhaul, and it's a bit riskier because it will mess up your file if nested tags can occur.

    0 讨论(0)
提交回复
热议问题