<?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[I would like to group all similar domains, not by alphabet.]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1696611097290-h.png" alt="H.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25006/i-would-like-to-group-all-similar-domains-not-by-alphabet</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 15:55:16 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25006.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Oct 2023 16:51:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 13:56:44 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a> and <strong>All</strong>,</p>
<p dir="auto">Again, I’m going to  <strong>simplify</strong> the problem, using a <strong><code>Python</code></strong> script, called <strong><code>Replacements_Lists.py</code></strong>, listed below :</p>
<pre><code class="language-py">
'''

Refer to : https://community.notepad-plus-plus.org/topic/19889/


- Given TWO files :

- A MAIN one, located in the MAIN view, containing a LIST of strings or lines

- A SECOND one, located in the SECONDARY view, containing :

    - A LIST of strings to REPLACE, EACH followed with a TABULATION and its CORRESPONDING replacement string


This script replaces EACH expression of the MAIN file by the CORRESPONDING replacement string, found in the SECONDARY file


NOTES :

- The REPLACEMENT strings may be ABSENT IF you do NOT write anything AFTER the TABULATION separator. Thus, these SPECIFIC searched strings will be DELETED

- The strings of the MAIN file, NOT found in the SECONDARY file, are simply REWRITTEN

- The LEADING strings of the SECONDARY file, NOT found in the MAIN file, are simply NOT used

- The list of the DIFFeRENT ranges &lt; SEARCHED string &gt; \t &lt; REPLACEMENT string &gt; must END with a FINAL line-break or NOTHING else ( \z )

'''

from Npp import editor1, editor2

replacements = dict(line.split('\t') for line in editor2.getText().splitlines() if line)

def replace_with(m):
    try:
        r = replacements[m.group()]
    except KeyError:
        r = m.group()
    return r

editor1.rereplace('(?-s).+', replace_with)
</code></pre>
<hr />
<p dir="auto">So, just follow this <strong>road map</strong> :</p>
<ul>
<li>
<p dir="auto">Open your <strong>entire</strong> file containing <strong>all</strong> your records ( about <strong><code>181,170</code></strong> ) in the <strong>main</strong> view</p>
</li>
<li>
<p dir="auto">Open your file containing the <strong><code>1.027</code></strong> lines, whose <strong>all</strong> the occurrences must be <strong>deleted</strong> in the <strong>main</strong> file</p>
</li>
<li>
<p dir="auto">Move this file in the <strong>secondary</strong> view ( <em>IMPORTANT</em> )</p>
</li>
</ul>
<p dir="auto">I suppose that these <strong>two</strong> files <em>ONLY</em> contains <strong>main</strong> domain names, <strong>one</strong> per line</p>
<p dir="auto">Run the <strong><code>Edit &gt; Blank operations &gt; Trim Leading and Trailing Space</code></strong> option for the <strong>two</strong> files</p>
<ul>
<li>
<p dir="auto">Now, in the <strong>secondary</strong> view, use this <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?&lt;=.)$</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\t</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">in order to produce a correct <strong>replacement</strong> list for some domain’s <strong>names</strong> by <strong>nothing</strong></p>
<ul>
<li>
<p dir="auto">Move back to your file in the <strong>main</strong> view</p>
</li>
<li>
<p dir="auto">Run the <strong><code>Plugins &gt; Python Script &gt; Scripts &gt; Replacements_List.py</code></strong> option</p>
</li>
</ul>
<p dir="auto">=&gt; Immediately, <strong>all</strong> the lines, of the <strong><code>main</code></strong> view, which match <strong>one</strong> of the lines of the <strong><code>secondary</code></strong> view, have been replaced with an <strong>empty</strong> line</p>
<ul>
<li>
<p dir="auto">Run the <strong><code>Edit &gt; Line Operations &gt; Remove Empty Lines</code></strong></p>
</li>
<li>
<p dir="auto">Finally save your <strong>uptaded</strong> file, in the <strong>main</strong> view</p>
</li>
</ul>
<p dir="auto">Voilà !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto">P.S. :</p>
<p dir="auto">If you need to <strong>install</strong> the <strong><code>Python Script</code></strong> plugin, follow this <a href="https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript">FAQ</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89810</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89810</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 10 Oct 2023 13:56:44 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 12:58:11 GMT]]></title><description><![CDATA[<p dir="auto">@ PeterJones<br />
Ok, Thank you</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89806</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89806</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Tue, 10 Oct 2023 12:58:11 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 12:57:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@Mohammad-Al-Thobiti</a> said in <a href="/post/89794">I would like to group all similar domains, not by alphabet.</a>:</p>
<blockquote>
<p dir="auto">How can I do this?</p>
</blockquote>
<p dir="auto">At some point, you need to take the lessons you’ve been taught through the dozens of regexes that people have handed you throughout this discussion, and try to figure it out yourself.</p>
<p dir="auto">----</p>
<h3>Useful References</h3>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/21965/please-read-before-posting">Please Read Before Posting</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/22022/template-for-search-replace-questions">Template for Search/Replace Questions</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">Formatting Forum Posts</a></li>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find other regular expressions (regex) documentation</a></li>
</ul>
<p dir="auto">----</p>
<p dir="auto"><em><strong>Please note</strong>: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you.  If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future.  But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin.  The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89805</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89805</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 10 Oct 2023 12:57:18 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 11:20:23 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1696936817126-c1b1e91a-6465-4333-b905-6fe87431ce9d-image.png" alt="c1b1e91a-6465-4333-b905-6fe87431ce9d-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89800</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89800</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Tue, 10 Oct 2023 11:20:23 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 10:59:19 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1696935553798-e090ecbe-d21f-4d02-83f0-f6c59c3ee670-image.png" alt="e090ecbe-d21f-4d02-83f0-f6c59c3ee670-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89798</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89798</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Tue, 10 Oct 2023 10:59:19 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 10:41:32 GMT]]></title><description><![CDATA[<p dir="auto">.example.com|.example2.com|.example3.com\s</p>
<p dir="auto">OK</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89796</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89796</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Tue, 10 Oct 2023 10:41:32 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 10:24:19 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1696933455630-8fc6c18d-b7fd-4c96-993d-d93f1cd3d202-image.png" alt="8fc6c18d-b7fd-4c96-993d-d93f1cd3d202-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89795</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89795</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Tue, 10 Oct 2023 10:24:19 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Tue, 10 Oct 2023 10:13:50 GMT]]></title><description><![CDATA[<p dir="auto">Hello @ guy038 &amp; All</p>
<p dir="auto">Thank you. everything is ok, I need to add more than one domine to the Find what:</p>
<p dir="auto">as you can see<br />
<img src="/assets/uploads/files/1696932764518-5c203023-6172-4dfa-ad8b-8e404222160d-image.png" alt="5c203023-6172-4dfa-ad8b-8e404222160d-image.png" class=" img-fluid img-markdown" /><br />
this is the code:</p>
<pre><code>\.real-news-online.com, myvnc.com, 1example.com, 2example.com\s
</code></pre>
<p dir="auto">is this the correct method?<br />
How can I do this?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89794</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89794</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Tue, 10 Oct 2023 10:13:50 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Mon, 09 Oct 2023 21:46:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a> and <strong>All</strong>,</p>
<p dir="auto">Let’s recapitulate from the <strong>very beginning</strong> !</p>
<hr />
<p dir="auto">If we start with this kind of <em>INPUT</em> text :</p>
<pre><code class="language-diff">127.0.0.1   a.z.xy.dummy-hyphen.org
127.0.0.1   a.example.com
127.0.0.1   cdef.x.example.com
127.0.0.1   my_site.net
127.0.0.1   b.dummy-hyphen.org
127.0.0.1   b.cde.fgh.example.com
127.0.0.1   abc.defgji.kkkkk.my_site.net
127.0.0.1   cd.xyztuv.ab-cd.4567.example.com
127.0.0.1   dummy-hyphen.org
127.0.0.1   example.com
</code></pre>
<p dir="auto">With the following <strong>regex</strong> S/R :</p>
<p dir="auto">SEARCH <strong><code>(?x) ^ \Q127.0.0.1 \E \h+ (?: [\w-]+ \. )* ( [\w-]+ \. [\w-]+ ) $</code></strong></p>
<p dir="auto">REPLACE <strong><code>\1</code></strong></p>
<p dir="auto">=&gt; We just keep the <strong>main</strong> domain ;</p>
<pre><code class="language-diff">dummy-hyphen.org
example.com
example.com
my_site.net
dummy-hyphen.org
example.com
my_site.net
example.com
dummy-hyphen.org
example.com
</code></pre>
<p dir="auto">Of course, your <strong>present</strong> file deals with about <strong><code>181,170</code></strong> lines !</p>
<p dir="auto">So, instead of using the <strong>last</strong> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>’s method to find out the different <strong>occurrences</strong> of <strong>each</strong> line ( again, a very <strong>clever</strong> method ! ), I will <strong>simplify</strong> the goal by using a <strong><code>Python</code></strong> script to get the job done more <strong>quickly</strong> !</p>
<p dir="auto">This script is an <strong>adaptation</strong> from a <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a>’s script. I named this script <strong><code>Count_Strings_Occurences.py</code></strong></p>
<pre><code class="language-py"># -*- coding: utf-8 -*-

'''

Adapted from :  https://community.notepad-plus-plus.org/topic/20598/show-a-list-of-same-word-before-replacement/2  and  .../20


By DEFAULT, this script PASTES, in a NEW tab,   a SORTED list of ALL the STRINGS of the CURRENT file, with their NUMBER of occurrences

IF a NORMAL selection EXISTS, the script PASTES a SORTED list of ALL the STRINGS of the SELECTION,    with their NUMBER of occurrences


NOTES : 

- The CURRENT file processed DO NOT need to be SORTED, in any way !

- If you want a SORTED list of ALL the LINES  with their NUMBER of occurrences, don't FORGET to INCLUDE all the POSSIBLE chars of the lines in the REGEX !

    For example, if file may contain the line 'zip-archive.net', the REGEX, after editor.research, should be  r'[\w.-]+', which includes the DOT and the DASH !

'''

from Npp import editor

sel_start = 0
sel_end = editor.getLength()
# Refer to :  https://community.notepad-plus-plus.org/topic/22378/pythonscript-ops-on-selection-if-any-all-text-otherwise/3

sel_start, sel_end = editor.getUserCharSelection()

word_matches = []
def match_found(m): word_matches.append(editor.getTextRange(m.span(0)[0], m.span(0)[1]))

editor.research(r'[\w.-]+', match_found, 0 , sel_start, sel_end)

histogram_dict = {}

for word in word_matches:
    if word not in histogram_dict:
        histogram_dict[word] = 1
    else:
        histogram_dict[word] += 1

output_list = []

for k in histogram_dict: output_list.append('{0:.&lt;50} {1}'.format(k, histogram_dict[k]))

#for k in histogram_dict: output_list.append('{}={}'.format(k, histogram_dict[k]))   # INITIAl format of Alan Kilborn

# For SPECIFICATIONS on the OUTPUT format, refer to :

# https://doc.python.org/2.7/library/string.html#format-specification-mini-language
# https://doc.python.org/2.7/library/string.html#format-examples

output_list.sort()
editor.copyText('\r\n'.join(output_list))

notepad.new()
editor.paste()

# console.clear() ; editor.research (r'\w+', lambda m: console.write (m.group(0) + '\n'))
</code></pre>
<hr />
<ul>
<li>So, <strong>select</strong> the <strong>random</strong> list of <strong><code>168</code></strong> lines, below.</li>
</ul>
<p dir="auto">Note that I suppose that the <strong><code>IPV4</code></strong> addresses and the <strong>sub</strong>-domains were previously <strong>deleted</strong></p>
<pre><code class="language-diff">zioninfosystems.net
zingcoach.net
ziph.net
zinoiosijek031.net
zindova.net
zip.net
zinoiosijek031.net
zip-archive.net
zinfandelreviews.net
zindova.net
zip.net
zinoiosijek031.net
zioninfosystems.net
zip-archive.net
ziomik.net
zioninfosystems.net
zip.net
zindova.net
zindova.net
ziph.net
ziph.net
zinfandelreviews.net
zinoiosijek031.net
zindova.net
zioninfosystems.net
zindova.net
zip.net
zindova.net
ziph.net
zinfandelreviews.net
zinoiosijek031.net
ziph.net
zinfandelreviews.net
zinoiosijek031.net
zinfandelreviews.net
zinfandelreviews.net
ziobaweek.net
zinoiosijek031.net
zinfandelreviews.net
zindova.net
zindova.net
zinoiosijek031.net
zinoiosijek031.net
zipaphoto.net
zinfandelreviews.net
zinfandelreviews.net
zingardi.net
zip.net
zipexpose.net
zindova.net
zip-archive.net
zip-archive.net
zindova.net
zioninfosystems.net
zipexpose.net
zipaphoto.net
ziph.net
zipbah.net
zinoiosijek031.net
zinfandelreviews.net
zip.net
zindova.net
zip.net
zindova.net
zingcoach.net
zinoiosijek031.net
zip.net
ziomik.net
zindova.net
zinoiosijek031.net
zioninfosystems.net
ziph.net
zioninfosystems.net
zinfandelreviews.net
zingardi.net
zinoiosijek031.net
zingardi.net
zingardi.net
ziph.net
zingardi.net
zinoiosijek031.net
zinoiosijek031.net
zingcoach.net
zindova.net
zip.net
zindova.net
zip-archive.net
ziph.net
ziobaweek.net
zinfandelreviews.net
zip.net
zinoiosijek031.net
zip.net
ziomik.net
zingardi.net
zindova.net
zinfandelreviews.net
ziph.net
ziobaweek.net
zinoiosijek031.net
zindova.net
zinfandelreviews.net
zip.net
zingcoach.net
zip-archive.net
zip-archive.net
zindova.net
zinfandelreviews.net
zingardi.net
zioninfosystems.net
zinoiosijek031.net
ziph.net
zioninfosystems.net
ziobaweek.net
zingcoach.net
ziph.net
zinoiosijek031.net
ziobaweek.net
zinfandelreviews.net
zip.net
zinoiosijek031.net
ziph.net
zinfandelreviews.net
zindova.net
zindova.net
zindova.net
zip-archive.net
zip.net
ziph.net
zindova.net
zioninfosystems.net
zinoiosijek031.net
zinoiosijek031.net
ziph.net
zinfandelreviews.net
zip.net
zingcoach.net
zinfandelreviews.net
zinoiosijek031.net
zingardi.net
zip-archive.net
zip.net
zinfandelreviews.net
zinoiosijek031.net
zindova.net
zinfandelreviews.net
zip.net
zioninfosystems.net
zingardi.net
zioninfosystems.net
zip-archive.net
zingcoach.net
zinoiosijek031.net
ziomik.net
zip.net
zingardi.net
zinfandelreviews.net
zip-archive.net
zindova.net
ziomik.net
zinoiosijek031.net
zindova.net
zinoiosijek031.net
zinfandelreviews.net
zinfandelreviews.net
ziph.net
zinoiosijek031.net
zingardi.net
</code></pre>
<ul>
<li>Run the <strong><code>Plugins &gt; Python Script &gt; Scripts &gt; Count_Strings_Occurrences.py</code></strong> <strong>Python</strong> script</li>
</ul>
<p dir="auto">=&gt; At once, a <strong>new</strong> tab will open with <strong>all</strong> the results :</p>
<pre><code class="language-diff">zindova.net....................................... 26
zinfandelreviews.net.............................. 24
zingardi.net...................................... 11
zingcoach.net..................................... 7
zinoiosijek031.net................................ 28
ziobaweek.net..................................... 5
ziomik.net........................................ 5
zioninfosystems.net............................... 12
zip-archive.net................................... 11
zip.net........................................... 18
zipaphoto.net..................................... 2
zipbah.net........................................ 1
zipexpose.net..................................... 2
ziph.net.......................................... 16
</code></pre>
<p dir="auto">Note that the entries are <strong>sorted</strong> by the line <strong>contents</strong>, to <strong>easily</strong> access any of these !</p>
<ul>
<li>
<p dir="auto">Thus, do a <strong>zero-length</strong> <em>RECTANGULAR</em> selection of <strong>all</strong> the numbers of this <strong>new</strong> tab, at column <strong><code>52</code></strong></p>
</li>
<li>
<p dir="auto">Run the <strong><code>Edit &gt; Line Operations &gt; Sort Lines As Integers Descending</code></strong> option</p>
</li>
</ul>
<p dir="auto">=&gt; You should get your <strong>expected</strong> <em>OUTPUT</em> :</p>
<pre><code class="language-diff">zinoiosijek031.net................................ 28
zindova.net....................................... 26
zinfandelreviews.net.............................. 24
zip.net........................................... 18
ziph.net.......................................... 16
zioninfosystems.net............................... 12
zingardi.net...................................... 11
zip-archive.net................................... 11
zingcoach.net..................................... 7
ziobaweek.net..................................... 5
ziomik.net........................................ 5
zipaphoto.net..................................... 2
zipexpose.net..................................... 2
zipbah.net........................................ 1
</code></pre>
<p dir="auto">Here you are !</p>
<hr />
<ul>
<li>
<p dir="auto">Proceed, in the same way, with your <strong>present</strong> file</p>
</li>
<li>
<p dir="auto">Switch to your file <strong>tab</strong> ( <em>selection</em> and <em>sort</em> are <strong>not</strong> required )</p>
</li>
<li>
<p dir="auto">Run again the <strong><code>Plugins &gt; Python Script &gt; Scripts &gt; Count_Strings_Occurrences.py</code></strong> <strong>Python</strong> script</p>
</li>
<li>
<p dir="auto">In the opened <strong>new</strong> tab, do a <strong>zero-length</strong> <em>RECTANGULAR</em> selection of <strong>all</strong> the numbers, at column <strong><code>52</code></strong></p>
</li>
<li>
<p dir="auto">Run the <strong><code>Edit &gt; Line Operations &gt; Sort Lines As Integers Descending</code></strong> option</p>
</li>
</ul>
<p dir="auto">Bingo !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89790</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89790</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 09 Oct 2023 21:46:33 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Mon, 09 Oct 2023 06:16:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> OK, I’ll take the bait… If you <em>really</em> want to count exclamation points:</p>
<p dir="auto">Add the missing exclamation point, but also add a separator:</p>
<p dir="auto"><strong>Find what : <code>^(!*)</code></strong><br />
<strong>Replace with : <code>$1!/\t</code></strong></p>
<p dir="auto">Now, group by tens:</p>
<p dir="auto"><strong>Find what : <code>(!{10})+</code></strong><br />
<strong>Replace with : <code>$0/</code></strong></p>
<p dir="auto">followed by:</p>
<p dir="auto"><strong>Find what : <code>!{10}</code></strong><br />
<strong>Replace with : <code>!</code></strong></p>
<p dir="auto">Repeat the above <em>two</em> steps until the first step finds nothing.</p>
<p dir="auto">Now, count the exclamation points in each digit and remove the forward slashes:</p>
<p dir="auto"><strong>Find what : <code>(?:(!{9})|(!{8})|(!{7})|(!{6})|(!{5})|(!{4})|(!{3})|(!{2})|(!{1})|())/</code></strong><br />
<strong>Replace with : <code>(?{1}9)(?{2}8)(?{3}7)(?{4}6)(?{5}5)(?{6}4)(?{7}3)(?{8}2)(?{9}1)(?{10}0)</code></strong></p>
<p dir="auto">This assumes there are no exclamation points or forward slashes elsewhere in the text. Of course, the forward slash (<code>/</code>) can be replaced with any character that is not in use.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89773</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89773</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 09 Oct 2023 06:16:42 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Mon, 09 Oct 2023 05:49:08 GMT]]></title><description><![CDATA[<p dir="auto">@ guy038  and <strong>All</strong>,</p>
<p dir="auto">Thank you my friends for the amazing results.</p>
<p dir="auto">We have received the correct information. The most commonly used domains cleverly.</p>
<p dir="auto">In any case, as you can see in the picture, the outcome is wonderful.</p>
<p dir="auto"><img src="/assets/uploads/files/1696830466631-h8.png" alt="H8.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">How do I write the code like this that you mentioned:</p>
<pre><code>SEARCH  (?x-s) ^ !                         (?= [^!\r\n]+ )        REPLACE   1\t
SEARCH  (?x-s) ^ !!                        (?= [^!\r\n]+ )        REPLACE   2\t
SEARCH  (?x-s) ^ !!!                       (?= [^!\r\n]+ )        REPLACE   3\t
SEARCH  (?x-s) ^ !!!!!!!!!!!!!!!!!!!!!!!!! (?= [^!\r\n]+ )        REPLACE  25\t
</code></pre>
<p dir="auto">Did I write until I reached Col: 6,597? I think it is difficult and takes a lot of time. And I want to thank all of you for all your efforts on this fascinating topic.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89772</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89772</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Mon, 09 Oct 2023 05:49:08 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 23:05:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a> and <strong>All</strong>,</p>
<p dir="auto">Oh, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>, your method of finding out <strong>how many</strong> times each address occurs, is very <strong>elegant</strong> and really <strong>clever</strong> ! I’d never have thought of such <strong>sophistication</strong> on my own :-((</p>
<hr />
<p dir="auto">So, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a>, starting with this <em>INPUT</em> file :</p>
<pre><code class="language-diff">zindova.net
zindova.net
zinfandelreviews.net
zinfandelreviews.net
zingardi.net
zingcoach.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
ziobaweek.net
ziomik.net
zioninfosystems.net
zioninfosystems.net
zip-archive.net
zip-archive.net
zip.net
zip.net
zip.net
zipaphoto.net
zipbah.net
zipexpose.net
ziph.next
ziph.next
</code></pre>
<p dir="auto">I’m using the <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>’s <strong>regex</strong>, that I <strong>slightly</strong> modified :</p>
<p dir="auto">SEARCH <strong><code>(?x-s) ^ ( !* ( .+ ) ) \R ( !* ) \2 $</code></strong></p>
<p dir="auto">REPLACE <strong><code>!\3\1</code></strong></p>
<ul>
<li>Run it <strong>several</strong> times, in order tp get the message <strong><code>Replace All: 0 occurrences were replaced</code></strong></li>
</ul>
<p dir="auto">=&gt; You should get this text :</p>
<pre><code class="language-diff">!zindova.net
!zinfandelreviews.net
zingardi.net
zingcoach.net
!!!!!!!!!!!!!!!!!!!!!!!!zinoiosijek031.net
ziobaweek.net
ziomik.net
!zioninfosystems.net
!zip-archive.net
!!zip.net
zipaphoto.net
zipbah.net
zipexpose.net
!ziph.next
</code></pre>
<p dir="auto">Now, we just add <strong>one</strong> <strong><code>!</code></strong> character to get the <strong>exact</strong> number of occurrences of <strong>each</strong> address</p>
<p dir="auto">SEARCH <strong><code>(?x-s) ^ (?= . )</code></strong></p>
<p dir="auto">REPLACE <strong><code>!</code></strong></p>
<pre><code class="language-diff">!!zindova.net
!!zinfandelreviews.net
!zingardi.net
!zingcoach.net
!!!!!!!!!!!!!!!!!!!!!!!!!zinoiosijek031.net
!ziobaweek.net
!ziomik.net
!!zioninfosystems.net
!!zip-archive.net
!!!zip.net
!zipaphoto.net
!zipbah.net
!zipexpose.net
!!ziph.next
</code></pre>
<ul>
<li>Then, run the <strong><code>Edit &gt; Line Operations &gt; Sort Lines Lexicographically Ascending</code></strong></li>
</ul>
<p dir="auto">=&gt; We get this <strong>sorted</strong> text :</p>
<pre><code class="language-diff">!!!!!!!!!!!!!!!!!!!!!!!!!zinoiosijek031.net
!!!zip.net
!!zindova.net
!!zinfandelreviews.net
!!zioninfosystems.net
!!zip-archive.net
!!ziph.next
!zingardi.net
!zingcoach.net
!ziobaweek.net
!ziomik.net
!zipaphoto.net
!zipbah.net
!zipexpose.net
</code></pre>
<p dir="auto">Finally, runing the <strong>four</strong> regex S/R, below :</p>
<pre><code class="language-diff">SEARCH  (?x-s) ^ !                         (?= [^!\r\n]+ )        REPLACE   1\t
SEARCH  (?x-s) ^ !!                        (?= [^!\r\n]+ )        REPLACE   2\t
SEARCH  (?x-s) ^ !!!                       (?= [^!\r\n]+ )        REPLACE   3\t
SEARCH  (?x-s) ^ !!!!!!!!!!!!!!!!!!!!!!!!! (?= [^!\r\n]+ )        REPLACE  25\t
</code></pre>
<p dir="auto">=&gt; You should end up with this <em>OUTPUT</em> text :</p>
<pre><code class="language-diff">25	zinoiosijek031.net
3	zip.net
2	zindova.net
2	zinfandelreviews.net
2	zioninfosystems.net
2	zip-archive.net
2	ziph.next
1	zingardi.net
1	zingcoach.net
1	ziobaweek.net
1	ziomik.net
1	zipaphoto.net
1	zipbah.net
1	zipexpose.net
</code></pre>
<p dir="auto">Which should be a <strong>practical</strong> document to exploit !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89770</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89770</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 08 Oct 2023 23:05:25 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 21:29:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@Mohammad-Al-Thobiti</a> said in <a href="/post/89768">I would like to group all similar domains, not by alphabet.</a>:</p>
<blockquote>
<p dir="auto">Thank you. I will clarify the issue.</p>
</blockquote>
<p dir="auto">Using the method I suggested, if you start with:</p>
<pre><code>zindova.net
zindova.net
zinfandelreviews.net
zinfandelreviews.net
zingardi.net
zingcoach.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
zinoiosijek031.net
ziobaweek.net
ziomik.net
zioninfosystems.net
zioninfosystems.net
zip-archive.net
</code></pre>
<p dir="auto">and do the repeated <strong>Replace All</strong>s, then sort, you’ll get:</p>
<pre><code>!!!!!!!!!!!!!!!!!!!!!!!!zinoiosijek031.net
!zindova.net
!zinfandelreviews.net
!zioninfosystems.net
zingardi.net
zingcoach.net
ziobaweek.net
ziomik.net
zip-archive.net
</code></pre>
<p dir="auto">The first line represents 25 occurrences — there are 24 leading exclamation points. Each of the next three lines represent two occurrences (one leading exclamation point). The remaining lines occurred only once.</p>
<p dir="auto">Is that not what you needed to accomplish?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89769</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89769</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sun, 08 Oct 2023 21:29:17 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 20:27:02 GMT]]></title><description><![CDATA[<p dir="auto">Thank you. I will clarify the issue.<br />
<img src="/assets/uploads/files/1696796737869-h7.png" alt="H7.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89768</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89768</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Sun, 08 Oct 2023 20:27:02 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 17:03:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@Mohammad-Al-Thobiti</a> said in <a href="/post/89765">I would like to group all similar domains, not by alphabet.</a>:</p>
<blockquote>
<p dir="auto">If you can sort or collect them from the most similar domains, please let me know.</p>
</blockquote>
<p dir="auto">Here’s a way; enter:</p>
<p dir="auto"><strong>Find what : <code>^(!*([^\r\n]+))\R(!*)\2$</code></strong><br />
<strong>Replace with : <code>!\3\1</code></strong></p>
<p dir="auto">and <strong>Replace All</strong> repeatedly until there are no more changes.</p>
<p dir="auto">Each line in the result will have an exclamation point at the beginning for each additional occurrence of the following text; so:</p>
<pre><code>argh.com
argh.com
asdf.net
asdf.net
asdf.net
asdf.net
ef.org
ef.org
ef.org
ef.org
ef.org
fasde.com
fasde.com
fasde.com
fasde.com
gorch.net
gorch.net
gorch.net
</code></pre>
<p dir="auto">would become:</p>
<pre><code>!argh.com
!!!asdf.net
!!!!ef.org
!!!fasde.com
!!gorch.net
</code></pre>
<p dir="auto">You can then sort that to put them in order by the number of exclamation points at the beginning.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89766</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89766</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sun, 08 Oct 2023 17:03:38 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 15:36:16 GMT]]></title><description><![CDATA[<p dir="auto">I would like to thank you for your useful information and those who contributed to this topic.</p>
<p dir="auto">This article has become my reference. <strong>It works nicely. Yes, we mean the same goal !</strong><br />
<img src="/assets/uploads/files/1696779317723-e1cc5900-4c79-4442-b4b0-f6e05814193c-image.png" alt="e1cc5900-4c79-4442-b4b0-f6e05814193c-image.png" class=" img-fluid img-markdown" /><br />
Right now. If you can sort or collect them from the most similar domains, please let me know.</p>
<p dir="auto">There are too many lines, starting with the most similar domain.</p>
<p dir="auto"><strong>Reason: To find the most “worried” domains because it takes many lines. I will delete them later, as you told us. However, the goal is to discover more domains with many characters or long URLs and I will block them in other programs.</strong></p>
<p dir="auto">How can this be done?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89765</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89765</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Sun, 08 Oct 2023 15:36:16 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 09:13:11 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a> and <strong>All</strong>,</p>
<p dir="auto">May I <strong>rephrase</strong> your question ? Let’s see if we mean the same <strong>goal</strong> !</p>
<p dir="auto">So, for example, from the <em>INPUT</em> text, below :</p>
<pre><code class="language-diff">abc.def.ghi.jkl.example.com
all.net
abc.def.example.com
abc.my_site.com
abc.def.ghi.all.net
my_site.com
abc.def.all.net
abc.def.ghi.jkl.mno.opq.my_site.com
example.com
</code></pre>
<p dir="auto">With the following regex S/R :</p>
<p dir="auto">SEARCH <strong><code>(?x) ^ (?: [\w-]+ \. )* ( [\w-]+ \. [\w-]+ ) $</code></strong></p>
<p dir="auto">REPLACE <strong><code>\1</code></strong></p>
<p dir="auto">We would get that text :</p>
<pre><code class="language-diff">example.com
all.net
example.com
my_site.com
all.net
my_site.com
all.net
my_site.com
example.com
</code></pre>
<p dir="auto">Then, using the <strong><code>Edit &gt; Line Operations &gt; Remove Duplicates Lines</code></strong> option, we would end up with this <em>OUTPUT</em> :</p>
<pre><code class="language-diff">example.com
all.net
my_site.com
</code></pre>
<p dir="auto">If this is <strong>exactly</strong> what you expect to, just go ahead !</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89760</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89760</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 08 Oct 2023 09:13:11 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 06:25:52 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1696746334841-4c731646-06c6-46ae-9da6-090c683c1e75-image.png" alt="4c731646-06c6-46ae-9da6-090c683c1e75-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89758</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89758</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Sun, 08 Oct 2023 06:25:52 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 06:24:23 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your efforts, my friends.<br />
I would like to tell you that the result is excellent.<br />
<img src="/assets/uploads/files/1696745991417-h5.png" alt="H5.png" class=" img-fluid img-markdown" /><br />
<strong>But an idea came to me: why not just delete the subdomain and keep only the main domain and then delete the similar ones?<br />
Is there a way to delete long link extensions? And keep the main domain?</strong></p>
<p dir="auto">Example:</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89757</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89757</guid><dc:creator><![CDATA[Mohammad Al Thobiti]]></dc:creator><pubDate>Sun, 08 Oct 2023 06:24:23 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sun, 08 Oct 2023 09:20:12 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a> and <strong>All</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a>, you should use the <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>’s approach, which works <strong>much better</strong> than mine !!</p>
<p dir="auto">In addition, in my <strong>previous</strong> post, I omitted to add the <strong>reverse</strong> regex to use, once your <strong>sort</strong> would be done :-((</p>
<p dir="auto">While the @coise’s method avoids any <strong>additional</strong> S/R and <strong>correctly</strong> mentions the <strong>reverse</strong> regex to run after the <strong>sort</strong> operation</p>
<p dir="auto">Note that I <strong>slightly</strong> Modified the <strong>first two</strong> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>’s regexes to get more <strong>rigorous</strong> ones ( See, at the <strong>end</strong> of this post the reason for these <strong>changes</strong> )</p>
<hr />
<p dir="auto">Thus, I would propose this road map :</p>
<ul>
<li>
<p dir="auto">First, from the <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>’s post, I would use this <strong>alternate</strong> regex formulation :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?x) ( [^.\r\n]+ ) \. ( [^!\r\n]+ )</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\2!\1</code></strong></p>
</li>
<li>
<p dir="auto">Click <strong><code>14th</code></strong> times on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
</li>
<li>
<p dir="auto">Run the <strong><code>Edit &gt; Line Operations &gt; Sort Lines Lexicographically Ascending</code></strong> option ( <strong>No</strong> [rectangular] selection is needed as you just keep the <strong>addresses</strong> )</p>
</li>
<li>
<p dir="auto">Thirdly, once the <strong>sort</strong> done, from the <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>’s post, use the alternate <strong>reverse</strong> regex S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?x) ( [^!\r\n]+ ) ! ( [^.\r\n]+ )</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\2.\1</code></strong></p>
</li>
<li>
<p dir="auto">Click <strong><code>14th</code></strong> times on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; You should  get all your addresses back, in the <strong>right</strong> order</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a> uses the <strong><code>\s</code></strong> class of characters, which is <strong>equivalent</strong> to <strong>any</strong> of the <strong><code>25</code></strong> characters, below, with the regex :</p>
<p dir="auto"><strong><code>(?x) \t | \n | \x{000B} | \x{000C} | \r | \x{0020} | \x{0085} | \x{00A0} | x{1680} | [\x{2000}-\x{200B}] |\x{2028} | \x{2029} | \x{202F} | \x{3000}</code></strong></p>
<p dir="auto">In the highly <strong>unlikely</strong> event that <strong>one</strong> of these characters is <strong>included</strong> in some addresses, I preferred to use the <strong><code>[\r\n]</code></strong> regex, which <em>ONLY</em> avoids these <strong>2</strong> <strong><code>EOL</code></strong> chars in addresses, instead of using the <strong><code>\s</code></strong> regex !</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89752</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89752</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 08 Oct 2023 09:20:12 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sat, 07 Oct 2023 18:53:19 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a> and <strong>All</strong>,</p>
<p dir="auto">Ah, ah ah… I’m very <strong>happy</strong> to announce that I’ve found out a <strong>general</strong> regex which can handle <strong>any</strong> number of sections ;-))</p>
<hr />
<p dir="auto">So, let’s begin with this simple <em>INPUT</em> text containing from <strong><code>2</code></strong> to <strong><code>13</code></strong> sections ( one of each ), pasted in a <strong>new</strong> tab :</p>
<pre><code class="language-diff">abc.def
abc.def.ghi
abc.def.ghi.jkl
abc.def.ghi.jkl.mno
abc.def.ghi.jkl.mno.pqr
abc.def.ghi.jkl.mno.pqr.stu
abc.def.ghi.jkl.mno.pqr.stu.vwx
abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0
abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123
abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456
abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456.789
abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456.789.€±¶
abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456.789.€±¶.Ø÷ß
</code></pre>
<ul>
<li>Move to the <strong>very beginning</strong> of the file ( <strong><code>Ctrl + Home</code></strong> )</li>
</ul>
<p dir="auto">First, we add the <strong><code>|.</code></strong> string at the <strong>beginning</strong> of <strong>every</strong> line, with the following <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?x-s) ^ (?= . )</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>|.</code></strong></p>
</li>
</ul>
<p dir="auto">Thus, we get :</p>
<pre><code class="language-diff">|.abc.def
|.abc.def.ghi
|.abc.def.ghi.jkl
|.abc.def.ghi.jkl.mno
|.abc.def.ghi.jkl.mno.pqr
|.abc.def.ghi.jkl.mno.pqr.stu
|.abc.def.ghi.jkl.mno.pqr.stu.vwx
|.abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0
|.abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123
|.abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456
|.abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456.789
|.abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456.789.€±¶
|.abc.def.ghi.jkl.mno.pqr.stu.vwx.yz0.123.456.789.€±¶.Ø÷ß
</code></pre>
<ul>
<li>Move to the <strong>very beginning</strong> of the file ( <strong><code>Ctrl + Home</code></strong> )</li>
</ul>
<p dir="auto">Now, this is the <strong>main</strong> regex S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?x-s) ^ ( .* \| ) ( (?: \. (?: (?! \| ) \S )+ )+ )  ( \. (?: (?! \. ) \S )+ )</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\1\3|\2</code></strong></p>
</li>
<li>
<p dir="auto">Click <strong><code>14th</code></strong> times on the <strong><code>Replace All</code></strong> button, till you get the message <strong><code>Replace All: 0 occurrences were replaced from caret to end-of-file</code></strong></p>
</li>
</ul>
<p dir="auto">=&gt; You should get the <strong>temporary</strong> text :</p>
<pre><code class="language-diff">|.def|.abc
|.ghi|.def|.abc
|.jkl|.ghi|.def|.abc
|.mno|.jkl|.ghi|.def|.abc
|.pqr|.mno|.jkl|.ghi|.def|.abc
|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
|.vwx|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
|.yz0|.vwx|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
|.123|.yz0|.vwx|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
|.456|.123|.yz0|.vwx|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
|.789|.456|.123|.yz0|.vwx|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
|.€±¶|.789|.456|.123|.yz0|.vwx|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
|.Ø÷ß|.€±¶|.789|.456|.123|.yz0|.vwx|.stu|.pqr|.mno|.jkl|.ghi|.def|.abc
</code></pre>
<ul>
<li>Move to the <strong>very beginning</strong> of the file ( <strong><code>Ctrl + Home</code></strong> )</li>
</ul>
<p dir="auto">Now, we just to get rid  of <strong>all</strong> the <strong><code>|</code></strong> chars as well as the <em>FIRST</em> <strong>dot</strong> of <strong>each</strong> line, with the <strong>regex</strong> S/R :</p>
<p dir="auto">SEARCH <strong><code>(?x) ^ \| \. | \|</code></strong></p>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
<p dir="auto">And we get our <strong>expected</strong> <em>OUTPUT</em> text :</p>
<pre><code class="language-diff">def.abc
ghi.def.abc
jkl.ghi.def.abc
mno.jkl.ghi.def.abc
pqr.mno.jkl.ghi.def.abc
stu.pqr.mno.jkl.ghi.def.abc
vwx.stu.pqr.mno.jkl.ghi.def.abc
yz0.vwx.stu.pqr.mno.jkl.ghi.def.abc
123.yz0.vwx.stu.pqr.mno.jkl.ghi.def.abc
456.123.yz0.vwx.stu.pqr.mno.jkl.ghi.def.abc
789.456.123.yz0.vwx.stu.pqr.mno.jkl.ghi.def.abc
€±¶.789.456.123.yz0.vwx.stu.pqr.mno.jkl.ghi.def.abc
Ø÷ß.€±¶.789.456.123.yz0.vwx.stu.pqr.mno.jkl.ghi.def.abc
</code></pre>
<hr />
<p dir="auto">So, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@mohammad-al-thobiti</a> :</p>
<ul>
<li>
<p dir="auto">Apply <strong>all</strong> the <strong>above</strong> steps against your <strong>real</strong> file</p>
</li>
<li>
<p dir="auto">Run the <strong><code>Edit &gt; Line Operations &gt; Sort Lines Lexicographically Ascending</code></strong> option ( <strong>No</strong> [rectangular] selection is needed as you just keep the <strong>addresses</strong> )</p>
</li>
<li>
<p dir="auto">Possibly, <strong>add</strong> back the <strong><code>127.0.0.1</code></strong> <strong>IPV4</strong> address, followed with <strong>two</strong> <strong><code>space</code></strong> chars with the <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?x-s) ^ (?= . )</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>(127.0.0.1  )</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">I’ve just seen the <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@coises</a>’s solution. I’m going to have a look at <strong>its</strong> solution which could be more <strong>simple</strong> than my <strong>regex</strong> solution !</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89749</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89749</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 07 Oct 2023 18:53:19 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sat, 07 Oct 2023 18:24:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29477">@Mohammad-Al-Thobiti</a></p>
<p dir="auto">Since there are so many levels, and you’re working with a temporary file anyway, we could make this less tricky. At <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a>’ suggestion, here we use an exclamation point to distinguish between forward and reversed domain names.</p>
<p dir="auto">Enter:</p>
<p dir="auto"><strong>Find what : <code>([^.\s]+)\.([^!\s]+)</code></strong><br />
<strong>Replace with : <code>\2!\1</code></strong></p>
<p dir="auto"><strong>Replace All</strong> repeatedly until it says 0 occurrences were replaced, then sort the file.</p>
<p dir="auto">If you need to change back to normal domain names after the sort, use:</p>
<p dir="auto"><strong>Find what : <code>([^!\s]+)!([^.\s]+)</code></strong><br />
<strong>Replace with : <code>\2.\1</code></strong></p>
<p dir="auto">and <strong>Replace All</strong> repeatedly until it says 0 occurrences were replaced.</p>
<hr />
<p dir="auto">The steps above will sort first by the top-level domain (.com, .net, etc.). If you need to have, say, <code>whatever.com</code> and <code>whatever.net</code> and <code>whatever.co.uk</code> sort together, then after reversing the domain names, use something like:</p>
<p dir="auto"><strong>Find what : <code>^([a-z]{2}![a-z]{2}|[^!]+)!(\S+)</code></strong><br />
<strong>Replace with : <code>\2 \1</code></strong></p>
<p dir="auto">and <strong>Replace All</strong> <em>once</em> before sorting. (This is not guaranteed to be correct for every case of two-letter top level domains, but it should get the common ones right.)</p>
<p dir="auto">To reverse, after sorting, use:</p>
<p dir="auto"><strong>Find what : <code>^(\S+) (\S+)</code></strong><br />
<strong>Replace with : <code>\2!\1</code></strong></p>
]]></description><link>https://community.notepad-plus-plus.org/post/89748</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89748</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sat, 07 Oct 2023 18:24:08 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sat, 07 Oct 2023 18:07:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/27184">@Coises</a> said in <a href="/post/89746">I would like to group all similar domains, not by alphabet.</a>:</p>
<blockquote>
<p dir="auto">I also realized the original poster probably wants domains like <a href="http://xxx.com" rel="nofollow ugc">xxx.com</a> and <a href="http://xxx.org" rel="nofollow ugc">xxx.org</a> and <a href="http://xxx.co.uk" rel="nofollow ugc">xxx.co.uk</a> to sort together, which adds an extra complexity.</p>
</blockquote>
<p dir="auto">I think your solution, without that, is sufficient for any reasonable need.  If the OP desires that complexity, they can take what we’ve already given them and read the documentation that I linked them to, and figure out the next level themselves.  (But if you really want to spend your time on that, I’d recommend doing initial searches from <code>blah.com</code>, <code>blah.co.uk</code>, etc, and turn those into <code>blah,com</code> and <code>blah,co,uk</code>; then use ! as the machine separator.  That way it will sort first by the <code>blah</code>, then by any more specific things above, which would keep <code>blah.com</code> and <code>blah.co.uk</code> near each other)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89747</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89747</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 07 Oct 2023 18:07:57 GMT</pubDate></item><item><title><![CDATA[Reply to I would like to group all similar domains, not by alphabet. on Sat, 07 Oct 2023 17:48:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> said in <a href="/post/89745">I would like to group all similar domains, not by alphabet.</a>:</p>
<blockquote>
<p dir="auto">Ugh. You deleted your post while I was replying.</p>
</blockquote>
<p dir="auto">I am sorry about that. It contained a good idea, implemented incorrectly. My “solution” rotated the parts of the domain name rather than reversing them.</p>
<p dir="auto">I didn’t know about exclamation points being a standard; I’ll use those instead of commas when I figure out how to do this correctly.</p>
<p dir="auto">I also realized the original poster probably wants domains like <code>xxx.com</code> and <code>xxx.org</code> and <code>xxx.co.uk</code> to sort together, which adds an extra complexity.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/89746</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/89746</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sat, 07 Oct 2023 17:48:20 GMT</pubDate></item></channel></rss>