I’ve developed a Notepad++ plugin that adds the option to keep only regex patterns in a text file.

When working with large text files and wanting to extract specific data from them, such as log files or data files, it’s convenient to be able to filter out everything in one click.

Filter everything but regex from text file

Match Regex pattern only in notepad++

With this plugin, it’s easy to filter out everything that doesn’t match the pattern. Just fill out the “Regex Pattern” field and click on “Keep Pattern”. After that, only the selected pattern is left.

Download the plugin RegexOnly

Filter all IP address from a text file with Regex in notepad++

To clear a log file from anything but IP addresses, just input this regex pattern and click “Keep Pattern” [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} (Updated to \. in the pattern, thanks to daniel.krause777 )

This pattern matches every string that has the structure of an IP address.

Keep all the words containing a specific letter or letters with Regex in notepad++

If you want to keep only words that contain specific characters you can use this pattern  \w*(c)\w*, it will keep only words that include the lower cased letter ‘c’. If you want both lower can and upper case you can use this pattern \w*(c|C)\w*

The thing I absolutely love about working with regex is its versatility. Almost everything can be solved, when using the correct pattern and the right tools.

Hope you like this plugin, you can let me know in the comments below if you have any improvements and other ideas.

Download the plugin RegexOnly

1 Comment

  1. daniel.krause777

    Hi, thanks for that! But it should be [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} instead of [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3} 😉

Leave a comment