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

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

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

16条回答
  •  甜味超标
    2020-12-08 05:05

    There is a very simple solution to this unless I have not understood the problem. The following regular expression:

    (.*)(>)(.*)
    

    will match the pattern specified in your post.

    So, in notepad++ you find (.*)(>)(.*) and replace it with \3.

    The regular expressions are basically greedy in the sense that if you specify (.*) it will match the whole line and what you want to do is break it down somehow so that you can extract the string you want to keep. Here, I have done exactly the same and it works fine in Notepad++ and Editplus3.

提交回复
热议问题