Using regular expressions to do mass replace in Notepad++ and Vim

前端 未结 16 1544
迷失自我
迷失自我 2020-12-08 04:25

So I\'ve got a big text file which looks like the following:

相关标签:
16条回答
  • 2020-12-08 05:12

    This will remove the option tag and just leave the letters in vim:

    :%s/<option.*>//g
    
    0 讨论(0)
  • 2020-12-08 05:16

    In notepad++

    Search

    (<option value="\w\w">)\w+">(.+)
    

    Replace with

    \1\2
    
    0 讨论(0)
  • 2020-12-08 05:16

    Having the same problem (with jQuery " done..." strings), but only in Notepad++, I asked, received good friendly replies (that made me understand what I had missed), then spent the time to build a detailed step-by-step explanation, see Finding Line Beginning using Regular expression in Notepad++

    Versailles, Tue 27 Apr 2010 22:53:25 +0200

    0 讨论(0)
  • 2020-12-08 05:20

    In Notepad++ you don't need to use Regular Expressions for this.

    Hold down alt to allow you to select a rectangle of text across multiple rows at once. Select the chunk you want to be rid of, and press delete.

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