<?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[occurences or comparison with a list]]></title><description><![CDATA[<p dir="auto">Hello everyone<br />
I hope I can find a solution to my little problem,</p>
<p dir="auto">I have 2 files, a firewall configuration file and another file with an ip address list,<br />
and I would like to know if the IP’s in the left side appear in the right side conf file.</p>
<p dir="auto">I tried with the COMPARE plugin but it does not give me the expected result</p>
<p dir="auto">Thanks for you help</p>
<p dir="auto"><img src="https://camo.nodebb.org/292ff35c0c2aa02847f3310da64f23bef459ceef?url=https%3A%2F%2Fi.postimg.cc%2FxdRL7rL8%2F2022-04-21-00-19-58-new-87-Notepad.png" alt="alt text" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22882/occurences-or-comparison-with-a-list</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 23:30:47 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22882.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Apr 2022 22:25:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to occurences or comparison with a list on Mon, 25 Apr 2022 07:45:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/chamzon-chamzon" aria-label="Profile: chamzon-chamzon">@<bdi>chamzon-chamzon</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/lycan-thrope" aria-label="Profile: lycan-thrope">@<bdi>lycan-thrope</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">OK… I understand that in <strong>real</strong> cases, this causes a complete <strong>failure</strong>  of the regex engine :-(( Why ?</p>
<p dir="auto">Well, let’s suppose the temporary file containing, <strong>first</strong>, your entire <strong>firewall configuration</strong> file followed with your entire <strong>IP-adresses list</strong> file</p>
<p dir="auto">Now, imagine the <strong>worst</strong> case : an <strong>unique</strong> match between the <strong>first</strong> IP-address of your <strong>firewall configuration</strong> file and the <strong>last</strong> IP-address of your <strong>IP-adresses list</strong></p>
<p dir="auto">Then, and despite I use a <strong>non-capturing</strong> regex group, the part of the regex <strong><code>(?s:.*?...)</code></strong> represents <strong>all</strong> the characters, included line-endings, right after the <strong>first</strong> IP-address till the <strong>same</strong> IP-address excluded, at the <strong>very end</strong> of file</p>
<p dir="auto">As you said that your <strong>firewall configuration</strong> file has about <strong><code>68,000</code></strong> lines, it’s easy to guess that it probably <strong>exceeds</strong> the capacity of the regex engine to <strong>handle</strong> such a <strong>gap</strong> of chars !!</p>
<hr />
<p dir="auto">So, in order to find out, somehow,  a <strong>work-around</strong> to this situation, could you give me :</p>
<ul>
<li>
<p dir="auto">The number of <strong>lines</strong> of your <strong>firewall configuration</strong> file and its approximate <strong>size</strong></p>
</li>
<li>
<p dir="auto">The number of <strong>lines</strong> of your <strong>IP-addreses</strong> list and its approximate <strong>size</strong></p>
</li>
<li>
<p dir="auto">A short example of your <strong>real</strong> firewall configuration file</p>
</li>
<li>
<p dir="auto">A short example of your <strong>real</strong> IP-addresses list</p>
</li>
</ul>
<p dir="auto">In order to get the <strong>raw</strong> text, click on that button, when writing your post, to insert text in the <strong>right</strong> way !</p>
<p dir="auto"><img src="/assets/uploads/files/1650872349886-41d95003-7608-410a-958d-539e9c906c41-capture-d-%C3%A9cran-2022-03-07-123711.png" alt="41d95003-7608-410a-958d-539e9c906c41-Capture d’écran 2022-03-07 123711.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Thanks for your time to collect these infos !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76303</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76303</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 25 Apr 2022 07:45:32 GMT</pubDate></item><item><title><![CDATA[Reply to occurences or comparison with a list on Sun, 24 Apr 2022 22:22:46 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></p>
<p dir="auto">Thank you very much ! you’re a boss !<br />
It works with the last regex.<br />
But is there any limitation ? because it works when I have few lines as config (like 50 lines), but when I use the whole file which has 68000 lines it doesn’t give any result.</p>
<p dir="auto">Thanks again,<br />
Kind regards,<br />
Chamzon</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76297</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76297</guid><dc:creator><![CDATA[chamzon chamzon]]></dc:creator><pubDate>Sun, 24 Apr 2022 22:22:46 GMT</pubDate></item><item><title><![CDATA[Reply to occurences or comparison with a list on Mon, 25 Apr 2022 07:10:51 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/chamzon-chamzon" aria-label="Profile: chamzon-chamzon">@<bdi>chamzon-chamzon</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/lycan-thrope" aria-label="Profile: lycan-thrope">@<bdi>lycan-thrope</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Ah… , OK ! Then, <strong>two</strong> possibilities :</p>
<ul>
<li>
<p dir="auto">If you want to say that the <strong><code>ip-netmask</code></strong> string may be <strong>preceded</strong> with <strong>possible</strong> leading <strong><code>space</code></strong> and/or <strong><code>tabulation</code></strong> characters, choose the following regex :</p>
<ul>
<li><strong><code>(?-si)^\h*ip-netmask\x20\K(.+)$(?=(?s:.*?^\1$))</code></strong></li>
</ul>
</li>
<li>
<p dir="auto">If you want to say that any <strong>non-null</strong> string, may <strong>precede</strong> the <strong><code>space</code></strong> char and the <strong><code>ip_address</code></strong>, which <strong>ends</strong> each <strong>current</strong> line, choose the following regex :</p>
<ul>
<li><strong><code>(?-si)^.+\x20\K(.+)$(?=(?s:.*?^\1$))</code></strong></li>
</ul>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76257</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76257</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 25 Apr 2022 07:10:51 GMT</pubDate></item><item><title><![CDATA[Reply to occurences or comparison with a list on Fri, 22 Apr 2022 14:10:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chamzon-chamzon" aria-label="Profile: chamzon-chamzon">@<bdi>chamzon-chamzon</bdi></a> ,</p>
<p dir="auto">The reason it didn’t work is that your screenshot misrepresented the data.  Regex are highly tailored to example data, and when you make us guess, we guess wrong.</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/topic/22022/faq-desk-template-for-search-replace-questions">https://community.notepad-plus-plus.org/topic/22022/faq-desk-template-for-search-replace-questions</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/76252</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76252</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 22 Apr 2022 14:10:48 GMT</pubDate></item><item><title><![CDATA[Reply to occurences or comparison with a list on Fri, 22 Apr 2022 12:52:44 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></p>
<p dir="auto">Thank you very much Guy038 ! It’s so kind.</p>
<p dir="auto">I’m not very familiar with the reghex but I see it’s very powerful !<br />
In my example, the word “ip-netmask” is not the begining of the line,<br />
so how can i change this to search any word at the begining ?</p>
<p dir="auto">Thank you</p>
<p dir="auto">for the moment, it gives me only one (wrong) result</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76251</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76251</guid><dc:creator><![CDATA[chamzon chamzon]]></dc:creator><pubDate>Fri, 22 Apr 2022 12:52:44 GMT</pubDate></item><item><title><![CDATA[Reply to occurences or comparison with a list on Thu, 21 Apr 2022 22:21:28 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/chamzon-chamzon" aria-label="Profile: chamzon-chamzon">@<bdi>chamzon-chamzon</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">You can <strong>easily</strong> achieve your goal with a <strong>regular expression</strong> search !</p>
<p dir="auto">Here is the road map :</p>
<ul>
<li>
<p dir="auto">Open a <strong>new</strong> N++ tab ( <strong><code>Ctrl + N</code></strong> )</p>
</li>
<li>
<p dir="auto">First, <strong>paste</strong> the contents of your <strong>firewall configuration</strong> file ( <strong><code>Ctrl + V</code></strong> )</p>
</li>
<li>
<p dir="auto">Then, <strong>append</strong> the contents of your <strong>ip-adresses</strong> list, <strong>right after</strong></p>
</li>
</ul>
<p dir="auto">Starting, for instance, with this <strong>example</strong> text :</p>
<pre><code class="language-diff">tag RJPROJ
ip-netmask 192.168.2.4
tag RJPROJ
ip-netmask 192.168.2.152
tag RJPROJ
ip-netmask 192.168.2.24
tag RJPROJ
ip-netmask 192.168.2.25
tag RJPROJ
ip-netmask 10.7.18.188
tag RJPROJ
ip-netmask 10.7.18.28
tag RJPROJ
ip-netmask 10.7.18.29
tag RJPROJ
ip-netmask 10.7.18.249
tag RJPROJ
ip-netmask 10.7.18.226
tag RJPROJ
ip-netmask 10.7.18.12
tag FJPROJ
ip-netmask 10.7.18.13
tag FJPROJ
ip-netmask 10.7.18.16
tag FJPROJ
ip-netmask 10.7.16.2
10.7.16.2
10.7.16.5
10.7.16.6
10.7.16.7
10.7.16.8
10.7.18.11
10.7.18.16
10.7.18.17
10.7.18.18
10.7.18.22
10.7.18.226
10.7.23.1
10.7.23.66
10.7.23.45
10.7.23.44
10.7.23.26
10.7.23.156
10.7.23.16
10.7.18.188
</code></pre>
<ul>
<li>
<p dir="auto">Now, open the <strong>MARK</strong> dialog ( <strong><code>Ctrl + M</code></strong> )</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?s-i)^ip-netmask\x20\K(.+)$(?=.*?^\1)</code></strong></p>
</li>
<li>
<p dir="auto"><strong>Un-tick</strong> all options</p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Bookmark line</code></strong>, <strong><code>Purge for each search</code></strong> and <strong><code>Wrap around</code></strong> options</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search <strong>mode</strong></p>
</li>
<li>
<p dir="auto">CLick on the <strong><code>Mark All</code></strong> button =&gt; <strong><code>4</code></strong> matches !</p>
</li>
</ul>
</li>
<li>
<p dir="auto">From this point, you can, <strong>either</strong> :</p>
<ul>
<li>
<p dir="auto">Click on the <strong><code>Copy Marked Text</code></strong> button and <strong>paste</strong> all the <strong>IP-adresses</strong> elsewhere</p>
</li>
<li>
<p dir="auto">Use the menu option <strong><code>Search &gt; Bookmark &gt; Copy Bookmarked Lines</code></strong> and <strong>paste</strong> all these <strong>specific</strong> lines elsewhere</p>
</li>
</ul>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76217</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76217</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 21 Apr 2022 22:21:28 GMT</pubDate></item><item><title><![CDATA[Reply to occurences or comparison with a list on Wed, 20 Apr 2022 23:03:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lycan-thrope" aria-label="Profile: lycan-thrope">@<bdi>lycan-thrope</bdi></a><br />
thanks for reply, i use the compare plugin bcause it’s the only one i know, i did find another one matching my need</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76211</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76211</guid><dc:creator><![CDATA[chamzon chamzon]]></dc:creator><pubDate>Wed, 20 Apr 2022 23:03:26 GMT</pubDate></item><item><title><![CDATA[Reply to occurences or comparison with a list on Wed, 20 Apr 2022 22:54:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chamzon-chamzon" aria-label="Profile: chamzon-chamzon">@<bdi>chamzon-chamzon</bdi></a><br />
That’s not how the Compare Plugin works, it checks two files and shows the differences between them. You have two completely different files, and all that will be highligted is the missing parts. The following sceenshot shows two different files being compared, and all that shows is similar things.</p>
<p dir="auto"><img src="/assets/uploads/files/1650495266043-acomparefilesexample.png" alt="Acomparefilesexample.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">This plugin is usually used to find the differernce between two files that are similar, like a newer copy of the same document to see the changes that were made, like in program code files.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76210</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76210</guid><dc:creator><![CDATA[Lycan Thrope]]></dc:creator><pubDate>Wed, 20 Apr 2022 22:54:28 GMT</pubDate></item></channel></rss>