Using wildcard search/replace in Notepad++

notepadregexsearchwildcards

Here's my problem: In a .txt file, I need to find and replace thousands of instances of syntax like this:

(see (a053007djfgspwdf))

or

(see (a053007djfgspwdf) and (a54134xsedgeg))

or

(see (a053007djfgspwdf), (a9554xsdfgsdfg) and (a54134xsedgeg))

There is a lot of variety between the beginning (see (a and the ending )) text strings. Can this be set up in Notepad++ using regex? If so, how would I do that? Thanks!

Best Answer

Sorry folks, I just find other answers complicated. (No disrespect intended towards the original posters.)

As this always shows up as the first search result, I'll add this in:

  1. Open the search/replace dialog (CTRL+F then the replace tab)
  2. Tick "Regular Expression" down the bottom
  3. Use .* as the wildcard

For example, I wanted to remove all instances of abp="1314", abp="1313", abp="1312" etc (basically the numbers are all different, which is why you want a wildcard to get rid of them).

In the replace dialog:

Find in what: abp=".*"
Replace with:

(You're replacing anything within those quotes with nothing to get rid of it)

Source: https://www.organicweb.com.au/17226/general-technology/notepad-wildcard/

Related Question