How to count the occurrence of a specific string in notepad++?

How can I count the number of occurrences of a string within a text selection?

I installed the TextFX plugin and I see the option to get the word count for selected portion of text in a file.

You don't need the TextFx plugin for this:

  • Menu "Search" > "Mark".

  • Set "Find what" to the string you want to count.

  • Enable "In selection".

  • Click "Mark All".

  • The bottom of the dialog will update with "Mark: n matches.

  • Click "Clear all marks" to remove the marks.

Example:

enter image description here


  • Paste your selection in a new tab

  • Press Ctrl+F

  • Type your word, string, or phrase into the "Find what" box

  • Click "Count"


Without the hassle of counting by hand or of installing anything additional : Search and replace by itself and Replace all. This will effectively give you the number of occurrences replaced without actually changing anything.