<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Show count of occurrences of a selected string]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I’d like to know the number of occurence of a word<br />
(When you double click on a word or select a specfic string) updated in real time and shown in the information bar (like sel, Ln, Col,…).<br />
The ctrl+f + count option allows you to count but it is too many operations.</p>
<p dir="auto">Can I design a plugin to achieve this purpose ?</p>
<p dir="auto">Thanks !</p>
<p dir="auto">Bob</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14992/show-count-of-occurrences-of-a-selected-string</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 04:45:30 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14992.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Dec 2017 10:23:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Show count of occurrences of a selected string on Fri, 29 Dec 2017 16:37:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bob-bob" aria-label="Profile: bob-bob">@<bdi>bob-bob</bdi></a></p>
<p dir="auto">You could do a plugin to get this behavior, or you could script it.  Here’s an example (may not be fully rounded out) in Pythonscript, I call it <code>SelectedTextCountIntoStatusBar.py</code>; you would run it once per Notepad++ session:</p>
<pre><code class="language-z">def callback_sci_UPDATEUI(args):
    if args['updated'] &amp; UPDATE.SELECTION:
        matches = []
        if editor.getTextLength() &lt; 100000:  # don't search "big" files
            if editor.getSelections() == 1 and not editor.getSelectionEmpty():
                try:
                    editor.research(r'\Q' + editor.getSelText() + r'\E', lambda m: matches.append(1))
                except:
                    matches = []
        l = len(matches)
        notepad.setStatusBar(STATUSBARSECTION.DOCTYPE, ' ' if l == 0 else '{} occurrence(s) of selected text'.format(l))

editor.callback(callback_sci_UPDATEUI, [SCINTILLANOTIFICATION.UPDATEUI])
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/29026</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29026</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 29 Dec 2017 16:37:43 GMT</pubDate></item></channel></rss>