[Tool usage] How does Notepad++ use regular expressions to find, match and replace

1. Introduction
When using the beyond compare tool for text comparison, there may be redundant irrelevant text content that will affect the comparison. At this time, it is necessary to replace and delete the content that is not related to the concerned comparison in notepad++. Therefore, some irrelevant text needs to be matched and deleted.
This article mainly introduces how to use the regular expression function of notepad++ for matching.
2. Application scenario
It is necessary to match and delete the content in “[]” in txt:
insert image description here
3. Operation step
1, ctrl+H, open the replacement window, configure it as shown in the figure below, and click “Replace All” to proceed replace.

Find what: \[.*\]
Replace with: 

insert image description here
2. The result after replacement is shown in the figure below:
insert image description here
4. Summary
1. \ is an escape character, otherwise the square brackets [] cannot be recognized;
2. ".*" means to match all similar strings;
other operations can be performed according to The above two are used flexibly.

Guess you like

Origin blog.csdn.net/xuxu_123_/article/details/130127914
Recommended