Notepad++ Find and Replace numbers in square brackets

Useful ApplicationsI was working with some text the other day which included a lot of references using numbers in square brackets; I needed to remove this text and wanted an easy way of doing it.

I did a little research and found that Notepad++, an application I already use, can do regular expression find and replace.

The regular expression for a number surrounded by square brackets is:

\[(\d+)\]

To use the regular expression in find and replace, enter the regular expression into the Find what box and change the Search Mode to Regular expression:

Regul;ar expression find and replace

When you hit Replace, or Replace All, the regular expression will be used to repalce the matching text with the supplied replacement value.

What should we write about next?

If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.

Your Name

Your Email

Suggested Topic

Suggestion Details

1 thought on “Notepad++ Find and Replace numbers in square brackets

  1. JDspeeder1 says:

    Thank you, this regex did exactly what I needed in OpenOffice Writer.

Leave a Reply

Your email address will not be published. Required fields are marked *