<?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[How to remove duplicate row in Find result?]]></title><description><![CDATA[<p dir="auto">Anyone who know  how to remove duplicate row in Find result?<br />
When linux grep is used, only one line is displayed even if several words match on one line.<br />
However, notepad find result displays a line for the number of matched words.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/12905/how-to-remove-duplicate-row-in-find-result</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 02:57:36 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12905.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Dec 2016 08:05:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to remove duplicate row in Find result? on Thu, 15 Dec 2016 15:10:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> Thank You!  You went above and beyond.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19991</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19991</guid><dc:creator><![CDATA[Casey Crockett]]></dc:creator><pubDate>Thu, 15 Dec 2016 15:10:39 GMT</pubDate></item><item><title><![CDATA[Reply to How to remove duplicate row in Find result? on Thu, 15 Dec 2016 18:48:20 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <strong>Casey Crockett</strong></p>
<p dir="auto">No problem ! So :</p>
<p dir="auto"><strong>1)</strong> :</p>
<p dir="auto"><strong>Casey</strong>, the <strong>first</strong> part, of the regex, <strong><code>(?-s)</code></strong>, is <strong>NOT</strong> a group, at all ! It’s an <strong>in-line pattern modifier</strong>. Our N++ <strong>regex</strong> engine can understand <strong>four</strong> modifiers :</p>
<ul>
<li>
<p dir="auto">The <strong><code>(?-s)</code></strong> <strong>modifier</strong> means that the <strong>dot</strong> ( <strong><code>.</code></strong> ) <strong>meta</strong>-character matches <strong>standard</strong> characters, ONLY, ( except for the <strong><code>\f</code></strong> character ), even if you previously checked the <strong>. matches newline</strong> option. The <strong>opposite</strong> syntax, <strong><code>(?s)</code></strong>, would force the regex engine to consider that the <strong>dot</strong> matches <strong>ANY</strong> character ( <strong>standard</strong> and <strong>EOL</strong> charcraters ), even if you did <strong>not</strong> check, previously, the <strong>.matches newline</strong> option.</p>
</li>
<li>
<p dir="auto">The <strong><code>(?-i)</code></strong> <strong>modifier</strong> forces the regex engine to search, in a <strong>sensitive</strong> way, even you did <strong>not</strong> check, previously, the <strong>Match case</strong> option. The <strong>opposite</strong> syntax <strong><code>(?i)</code></strong> would do a search, <strong>rergardless</strong> to <strong>case</strong> of letters, even if you, previously, checked the <strong>Match case</strong> option.</p>
</li>
</ul>
<p dir="auto"><strong>Two</strong> other modifiers, <strong>less</strong> used, are, also, available :</p>
<ul>
<li>
<p dir="auto">The <strong><code>(?m)</code></strong> <strong>modifier</strong>, which means that the <strong><code>^</code></strong> and <strong><code>$</code></strong> <strong>assertions</strong> represent, respectively, the <strong>beginning</strong> and <strong>end</strong> of <strong>any</strong> line ( <strong>default</strong> N++ behaviour ). The <strong>opposite</strong> syntax <strong><code>(?-m)</code></strong> means that the <strong><code>^</code></strong> and <strong><code>$</code></strong> <strong>assertions</strong> represent, ONLY, the <strong>very beginning</strong> and the <strong>very end</strong> of the file</p>
</li>
<li>
<p dir="auto">The <strong><code>(?-x)</code></strong> <strong>modifier</strong>, which means that any <strong>space</strong> character, in the regex, is significant ( <strong>default</strong> N++ behaviour ). The <strong>opposite</strong> syntax <strong><code>(?x)</code></strong> means that you may <strong>separate</strong> the different parts of a <strong>complex</strong> regex with some <strong>space</strong> character, which are <strong>ignored</strong> by the regex engine. Note the the <strong>two</strong> syntaxes <strong><code>[ ]</code></strong>, with a <strong>space</strong> between the <strong>two square</strong> brackets or <strong><code>\ </code></strong>, with a <strong>space</strong>, after the <strong>anti-slash</strong> character, stands for an <strong>true space</strong> character !</p>
</li>
<li>
<p dir="auto">Note that you may <strong>group</strong> these <strong>modifiers</strong>, as, for instance, <strong><code>(?s-i)</code></strong> or <strong><code>(?xi-s)</code></strong> and that a modifier takes <strong>effect</strong>, till the <strong>opposite</strong> form is found, further on, in the regex or, of course, till the <strong>end</strong> of the regex</p>
</li>
</ul>
<p dir="auto"><strong>2)</strong> :</p>
<ul>
<li>
<p dir="auto">Outside a <strong>character class</strong> ( <strong><code>[....]</code></strong> ), the <strong>escape</strong> sequence <strong><code>\R</code></strong> matches <strong>ANY Unicode New line</strong> sequence. The <strong>exact</strong> definition of the <strong>escape</strong> sequence <strong><code>\R</code></strong> is <strong><code>(?&gt;\r\n|[\n\x0b\f\r\x85\x{2028}\x{2029}])</code></strong>.</p>
</li>
<li>
<p dir="auto">Just notice the <strong>atomic group</strong> contruction, which means that, for instance, if the <strong><code>\R</code></strong> form would match the two <strong>End-of-Line</strong> characters <strong><code>\r\n</code></strong>, the regex engine will <strong>never</strong> try to <strong>backtrack</strong>, for matching the <strong>possible remainder</strong> of the <strong>overall</strong> regex, located after an <strong><code>\R</code></strong> !</p>
</li>
<li>
<p dir="auto">But, most of the time, we may, <strong>simply</strong>, consider that the <strong><code>\R</code></strong> syntax matches <strong>ANY</strong> kind of <strong>EOL</strong> character :</p>
<ul>
<li>
<p dir="auto">The sequence <strong><code>\r\n</code></strong> ( case of a <strong>Windows</strong> End of Line )</p>
</li>
<li>
<p dir="auto">The <strong><code>\n</code></strong> character ( case of a <strong>Unix</strong> End of Line )</p>
</li>
<li>
<p dir="auto">The <strong><code>\r</code></strong> character ( case of a <strong>Machintosh</strong> End of Line )</p>
</li>
</ul>
</li>
</ul>
<hr />
<p dir="auto">Therefore, the regex <strong><code>(?-s)(^.*\R)\1+</code></strong> tries to find :</p>
<ul>
<li>
<p dir="auto">From <strong>beginning</strong> of line, ANY range of <strong>standard</strong> characters, even <strong>empty</strong>, followed by the current <strong>EOL</strong> character(s)</p>
</li>
<li>
<p dir="auto">This <strong>complete</strong> current line is stored as <strong>group 1</strong>, due to the couple of <strong>parentheses</strong>, after the <strong>modifier</strong></p>
</li>
<li>
<p dir="auto">The regex engine, then, searches for any <strong>additional</strong> line(s), <strong>identical</strong> to the <strong>previous</strong> one ( The <strong><code>+</code></strong> <strong>quantifier</strong> is equivalent to <strong><code>{1,}</code></strong> )</p>
</li>
<li>
<p dir="auto">In <strong>replacement</strong>, the block of <strong>identical</strong> lines ( the <strong>first</strong> and the <strong>additional</strong> ones ) is replaced by <strong>ONE</strong> occurrence, only, of that line ( <strong><code>\1</code></strong> )  !</p>
</li>
</ul>
<hr />
<p dir="auto">To go further on, refer, <strong>firstly</strong>, to the Notepad++ <strong>wiki</strong> article, dealing with <strong>regular</strong> expressions, :</p>
<p dir="auto"><a href="http://docs.notepad-plus-plus.org/index.php/Regular_Expressions" rel="nofollow ugc">http://docs.notepad-plus-plus.org/index.php/Regular_Expressions</a></p>
<hr />
<p dir="auto">In addition, you’ll find <strong>good documentation</strong>, about the new <strong>Boost C++ Regex library, v1.55.0</strong> ( similar to the <strong>PERL Regular Common Expressions, v1.48.0</strong> ), used by <strong><code>Notepad++</code></strong>, <em>since its <strong><code>6.0</code></strong> version</em>, at the <strong>TWO</strong> addresses below :</p>
<p dir="auto"><a href="http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html" rel="nofollow ugc">http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html</a></p>
<p dir="auto"><a href="http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html" rel="nofollow ugc">http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html</a></p>
<ul>
<li>
<p dir="auto">The <strong>FIRST</strong> link explains the <strong>syntax</strong>, of regular expressions, in the <strong>SEARCH</strong> part</p>
</li>
<li>
<p dir="auto">The <strong>SECOND</strong> link explains the <strong>syntax</strong>, of regular expressions, in the <strong>REPLACEMENT</strong> part</p>
</li>
</ul>
<hr />
<p dir="auto">You may, also, look for <strong>valuable</strong> informations, on the <strong>sites</strong>, below :</p>
<p dir="auto"><a href="http://www.regular-expressions.info" rel="nofollow ugc">http://www.regular-expressions.info</a></p>
<p dir="auto"><a href="http://www.rexegg.com" rel="nofollow ugc">http://www.rexegg.com</a></p>
<p dir="auto"><a href="http://perldoc.perl.org/perlre.html" rel="nofollow ugc">http://perldoc.perl.org/perlre.html</a></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19983</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19983</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 15 Dec 2016 18:48:20 GMT</pubDate></item><item><title><![CDATA[Reply to How to remove duplicate row in Find result? on Wed, 14 Dec 2016 23:29:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> Could you explain how that regular expression works?  In particular, the parts I’m curious about are in the first group, ?-s, and in the second group, the \R.  Thanks.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19981</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19981</guid><dc:creator><![CDATA[Casey Crockett]]></dc:creator><pubDate>Wed, 14 Dec 2016 23:29:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to remove duplicate row in Find result? on Thu, 15 Dec 2016 01:41:26 GMT]]></title><description><![CDATA[<p dir="auto">Hello <strong>Dongwan Shin</strong>,</p>
<p dir="auto">Quite easy ! Once you get your results, in the <strong>Find Result</strong> panel :</p>
<ul>
<li>
<p dir="auto"><strong>RIGHT</strong>-click on the <strong>green</strong> line, with the <strong>absolute path</strong> of your file, and the number of <strong>hits</strong></p>
</li>
<li>
<p dir="auto">Select the option <strong>Copy</strong></p>
</li>
<li>
<p dir="auto">Open a <strong>new</strong> tab ( <strong>Ctrl + N</strong> )</p>
</li>
<li>
<p dir="auto">Click on this <strong>new</strong> file to get the <strong>focus</strong></p>
</li>
<li>
<p dir="auto">Paste the <strong>clipboard</strong> contents ( <strong>Ctrl +V</strong> )</p>
</li>
<li>
<p dir="auto">Move <strong>back</strong> to the <strong>very beginning</strong> of this <strong>new</strong> file</p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong>Ctrl + H</strong> )</p>
</li>
<li>
<p dir="auto">Type <strong><code>(?-s)(^.*\R)\1+</code></strong> in the <strong>Find what:</strong> zone</p>
</li>
<li>
<p dir="auto">Type <strong><code>\1</code></strong> in the <strong>Replace with:</strong> zone</p>
</li>
<li>
<p dir="auto">Select the <strong>Regular expression</strong> search mode</p>
</li>
<li>
<p dir="auto">Click on the <strong>Replace All</strong> button</p>
</li>
<li>
<p dir="auto">Finally, <strong>save</strong> this list of <strong>NON-duplicate</strong> lines</p>
</li>
</ul>
<p dir="auto">Et voilà !</p>
<p dir="auto">Best regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19913</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19913</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 15 Dec 2016 01:41:26 GMT</pubDate></item></channel></rss>