<?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[Interrupted list]]></title><description><![CDATA[<p dir="auto">Hi to all!<br />
I have a problem with matching regex strings. So, I tried but I still need help.</p>
<p dir="auto"><strong>I summarized my situation in four points below:</strong></p>
<ol>
<li>a string like this to be matched:<br />
Abc 2:5a; 24:51d, 53; 1:9b, 22-23c; 1:22-23, 9; 1:22-23, 24-25;</li>
<li>this string should not be matched if it is found at the start of a line, that is, a new row; only in the middle o at the end of a row.</li>
<li>if in the middle or at the end of a string/row, it should match only if it starts with capital letter. E.g. Abc, not abc</li>
<li>After matching the Replacing I need is like this:<br />
Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23c; Abc 1:22-23, 9; Abc 1:22-23, 24-25;</li>
</ol>
<p dir="auto">This what I tried, but it is not good enough:  ((((\d)?\w*(.)?\s\d*:\d*)((-|:|,)?\s)?)(((-)?|(\d*))?(,)?(\s)?){5})</p>
<p dir="auto">Thank you for any help.<br />
Dumitru.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21327/interrupted-list</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 13:31:59 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21327.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Jun 2021 13:59:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Interrupted list on Thu, 01 Jul 2021 09:11:53 GMT]]></title><description><![CDATA[<p dir="auto">Hi to all!</p>
<p dir="auto">Thank you a lot for your very comprehensive response.<br />
I appreciate it.</p>
<p dir="auto"><code>Have a nice day today!</code><br />
Best regards,<br />
Dumitru</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67567</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67567</guid><dc:creator><![CDATA[Dumitru S.]]></dc:creator><pubDate>Thu, 01 Jul 2021 09:11:53 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Thu, 01 Jul 2021 09:16:44 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/21902">@dumitru-s</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/7377">@alan-kilborn</a> and <strong>All</strong>,</p>
<p dir="auto">Sorry for my <strong>very late</strong> reply ! Anyway, the <strong>good</strong> thing is that you studied some <strong>regex</strong> formulations, in between ;-))  Thanks to <strong>Alan</strong> and <strong>Peter</strong>, you have the explanation about the <strong><code>\x20</code></strong> syntax. When using the <strong>red</strong> <strong><code>Markdown</code></strong> marking, I very often adopt this form, instead of a <strong>true</strong> space char, for the <strong>reason</strong> below :</p>
<p dir="auto">On our forum, <strong>multiples space</strong> characters are normally compressed to a <strong>simple</strong> one ! Indeed, create a <strong>new</strong> post start a <strong>reply</strong> to someone and type in <strong><code>abc</code></strong>, then hit <strong><code>10</code></strong> times the <strong>space</strong> bar and type in <strong><code>def</code></strong>, as below :</p>
<pre><code class="language-z">abc          def
</code></pre>
<p dir="auto">It corresponds to a regex, which, simply, looks for the string <strong><code>abc</code></strong>, followed by <strong><code>10</code></strong> <strong>space</strong> characters and the string <strong><code>def</code></strong></p>
<p dir="auto">As you can see, in the <strong>preview</strong> panel, on the <strong>right</strong> side, we simply get the string <strong><code>abc def</code></strong>. But, if I decide to use, instead, the regex <strong><code>abc\x20{10}def</code></strong>, no more <strong>ambiguity</strong> !</p>
<p dir="auto">The <strong><code>\xNN</code></strong> or <strong><code>\x{NN}</code></strong> syntaxes, where each <strong><code>N</code></strong> represents an <strong>single hexadecimal</strong> digit from <strong><code>0</code></strong> to <strong><code>F</code></strong> can be used to search <strong>any</strong> character, with hexadecimal code <strong><code>NN</code></strong>, in an <strong><code>ANSI</code></strong> encoded file</p>
<p dir="auto">In order to find any <strong>Unicode</strong> char, of the <strong><code>BMP</code></strong> ( <strong>Basic multilingual Plane</strong> ), in an <strong>Unicode</strong> encoded file, use, preferably, the <strong><code>\x{NNNN}</code></strong> syntax</p>
<p dir="auto">Now, if you really want to insert a text, containing <strong>multiple consecutive space</strong> chars, use for instance, this <strong><code>Mardown</code></strong> syntax :</p>
<p dir="auto">~~~z</p>
<pre><code class="language-z">Raw        text      here,     with     respect    of      SPACE      chars
</code></pre>
<p dir="auto">~~~</p>
<hr />
<p dir="auto">Let’s go back to the <strong>regex</strong> explanations ! If we use the <strong><code>ABNF</code></strong> syntax ( <em>Augmented Backus–Naur Form</em> ) ( Refer <a href="https://en.wikipedia.org/wiki/Augmented_Backus%E2%80%93Naur_form" rel="nofollow ugc">here</a> ) with the <strong>definitions</strong> :</p>
<pre><code class="language-z">SP      =  %x20     ;  SPACE char
upper   =  %41-5A   ;  A-Z
lower   =  %61-7A   ;  a-z
digit   =  %30-39   ;  0-9
number  =  1*digit  ;  From 1 to any number
</code></pre>
<p dir="auto">And being <strong>aware</strong> of the general notations <strong><code>[X Y ... Z]</code></strong> which means <strong><code>0*1(X Y ... Z)</code></strong> and <strong><code>(X/Y/...Z)</code></strong> which means <strong><code>X OR Y OR .... OR Z</code></strong></p>
<p dir="auto">Your expression <strong><code>(3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)</code></strong>, <strong>preceded</strong> by a <strong><code>space</code></strong> char, can be expressed as :</p>
<p dir="auto"><strong><code>SP ["("] [number] upper 1*lower 2*( SP number ":" number [lower] [ "-" number [lower] ] [ "," SP number [ "-" number ] ] ( ";" / ")" ) )</code></strong></p>
<p dir="auto">leading to the <strong>search</strong> expression of the <strong>first</strong> regex S/R :</p>
<pre><code class="language-z">(?x-i)                    #  FREE-SPACING mode / NON-INSENSITIVE to case
(?&lt;=\x20)                 #  IF PRECEDED with a SPACE char, searches for ...
\(?                       #  an OPTIONAL OPENING parenthese followed with ...
(\d+)?                    #  an OPTIONAL GROUP 1 containing a NUMBER and ...
( \u\l+ )                 #  an UPPER-CASE letter, followed with some LOWER-CASE letters, stored as GROUP 2, which will be inserted, during REPLACEMENT, between TWO AROBAS chars
(                         #  START of GROUP 3
  \x20 \d+ : \d+ \l?      #    A SPACE char followed with a NUMBER, a COLON char, an other NUMBER and an OPTIONAL LOWER-CASE letter
  ( - \d+ \l? ) ?         #    An OPTIONAL GROUP 4, containing a DASH, followed with a NUMBER and aN OPTIONAL LOWER-CASE letter
  (                       #    START of an OPTIONAL GROUP 5, containing :
    , \x20 \d+ (- \d+)?   #      A COMMA followed with a SPACE char, then a NUMBER followed by an OPTIONAL GROUP 6, containing a DASH char followed with a NUMBER
  )?                      #    END of the OPTIONAL GROUP 5
  [;)]                    #    Ending with, either, a SEMMICOLON char OR a CLOSING parenthese
) {2,}                    #  End of GROUP 3, present, at LEAST, TWO times
</code></pre>
<p dir="auto">In <strong>replacement</strong>, we simply rewrite the <strong>overall</strong> match <strong><code>$0</code></strong>, followed with the <strong>group 2</strong>, <strong><code>\2</code></strong>, between <strong>two</strong> <strong><code>@</code></strong> chars !</p>
<hr />
<p dir="auto">Now, regarding the <strong>second</strong> regex S/R, we must :</p>
<ul>
<li>
<p dir="auto"><strong>Add</strong> the string, located between <strong>two</strong> <strong><code>@</code></strong> chars, <strong>after</strong> <strong>each</strong> <strong><code>;</code></strong>, but the <strong>last</strong></p>
</li>
<li>
<p dir="auto">And, of course, <strong>delete</strong> the <strong>temporary</strong> string <strong><code>@ ••••• @</code></strong>, added by the <strong>first</strong> S/R, above</p>
</li>
</ul>
<p dir="auto">leading to this <strong>search</strong> regex :</p>
<pre><code class="language-z">(?x-is)               #  FREE-SPACING mode / NON-INSENSITIVE to case / A DOT matches a SINGLE STANDARD character ONLY
  ;                   #    Searches for a SEMICOLON char ...
  (?=                 #    ONLY IF :
    .+                #      followed with the GREATEST range of chars till ...
    [;)]              #      a LAST ; character OR a CLOSING parenthese
    @                 #      followed with an ARROBAS and ...
    ( \u\l+ )         #      an UPPER-CASE letter and some LOWER-CASE letters, stored as GROUP 1
    @                 #      and followed by a LAST ARROBAS char
  )                   #    END of the LOOK-AHEAD assertion
|                     #  OR
  @ .+? @             #    searches an ARROBAS char, followed by the SMALLEST range of STANDARD characters, till ... a SECOND ARROBAS char
</code></pre>
<p dir="auto">In <strong>replacement</strong> :</p>
<ul>
<li>
<p dir="auto">we use a conditional syntax <strong><code>?1••••</code></strong> which means that the searched <strong>semicolon</strong> will be replaced by <strong>itself</strong>, followed with a <strong>space</strong> char <strong><code>\x20</code></strong> and the contents of <strong>group 1</strong> <strong><code>\1</code></strong> <em>ONLY IF</em> the <strong><code>group 1</code></strong> <strong>exists</strong> ( i.e. if the <strong>first</strong> alternative matched ! )</p>
</li>
<li>
<p dir="auto">If the <strong>second</strong> alternative matches, as <strong><code>group 1</code></strong> does <strong>not</strong> exist, the <strong>temporary</strong> string <strong><code>@•••••@</code></strong> is then <strong>deleted</strong> !</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67359</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67359</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 01 Jul 2021 09:16:44 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Thu, 24 Jun 2021 13:15:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said in <a href="/post/67332">Interrupted list</a>:</p>
<blockquote>
<p dir="auto"><code>\x20</code> is another way of expressing a single space character.<br />
It is often used in regular expression posts here because it is much easier to see than a space.</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/21902">@Dumitru-S</a> ,</p>
<p dir="auto">Further to what Alan said: because the FIND expression you are using includes the <code>(?x-i)</code> and <code>(?x-is)</code> syntax, normal whitespace in the regular expression is used only for readability and will <em>not</em> match space characters; in order to match the space character in a <a href="https://npp-user-manual.org/docs/searching/#search-modifiers" rel="nofollow ugc"><code>(?x)</code> expression</a>, you have to encode the space – and, as Alan explained, <code>\x20</code> is one way to encode the space character: see the <a href="https://npp-user-manual.org/docs/searching/#non-ascii-characters" rel="nofollow ugc">description of <code>\xℕℕ</code> in the usermanual</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67339</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67339</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 24 Jun 2021 13:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Thu, 24 Jun 2021 11:21:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/21902">@Dumitru-S</a></p>
<p dir="auto"><code>\x20</code> is another way of expressing a single space character.<br />
It is often used in regular expression posts here because it is much easier to see than a space.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67332</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67332</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 24 Jun 2021 11:21:58 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Thu, 24 Jun 2021 11:02:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a>  and all!<br />
I went and I studied all that you did above and I understood everything except  <code>\x20</code>.  So, if you do not mind to explain what it stands for, that would be wonderful. Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67331</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67331</guid><dc:creator><![CDATA[Dumitru S.]]></dc:creator><pubDate>Thu, 24 Jun 2021 11:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Fri, 18 Jun 2021 04:00:28 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> !<br />
In a previous post you mentioned that you might give some explanation on these regex S/R. So, I would like to ask whether you  would you like to help me understand what just happened especially with the following two sets of regex that you offered me:</p>
<p dir="auto">SEARCH: <code>(?x-i) (?&lt;=\x20) (? (\d+)? ( \u\l+ ) ( \x20 \d+ : \d+ \l? (- \d+ \l? )? ( ,\x20 \d+ (- \d+)? )? [;)] ) {2,}</code><br />
REPLACE <code>$0@\2@</code></p>
<p dir="auto">SEARCH: <code>(?x-is) ; (?= .+ [;)] @ ( \u\l+ ) @ ) | @ .+? @</code><br />
REPLACE: <code>?1;\x20\1</code></p>
<p dir="auto">This explanation of the regex above  would be a real help and a true progress for me personally.<br />
Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67153</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67153</guid><dc:creator><![CDATA[Dumitru S.]]></dc:creator><pubDate>Fri, 18 Jun 2021 04:00:28 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Thu, 17 Jun 2021 14:35:33 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> said in <a href="/post/67072">Interrupted list</a>:</p>
<blockquote>
<p dir="auto">REPLACE $0@\2@</p>
</blockquote>
<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a>!<br />
I marveled when I saw that what you wrote really worked. They work as a charm and that goes to your credit and credibility. That is why I am  coming back to simply point that out.</p>
<ol>
<li>To resume, your two step regex worked nicely in two steps:<br />
This 1st Step:<br />
SEARCH:  (?x-i) (?&lt;=\x20) (? (\d+)? ( \u\l+ ) ( \x20 \d+ : \d+ \l? (- \d+ \l? )? ( ,\x20 \d+ (- \d+)? )? [;)] ) {2,}<br />
REPLACE $0@\2@</li>
</ol>
<p dir="auto">made this text:<br />
text before Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;<br />
text before (Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<br />
text before (3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<br />
text before 3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;</p>
<p dir="auto">into this:<br />
text before Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a><br />
text before (Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a><br />
text before (3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a><br />
text before 3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a></p>
<hr />
<p dir="auto">And this 2d Step:<br />
SEARCH: (?x-is) ; (?= .+ [;)] @ ( \u\l+ ) @ ) | @ .+? @<br />
REPLACE: ?1;\x20\1</p>
<p dir="auto">made the (above produced) text:<br />
text before Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a><br />
text before (Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a><br />
text before (3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a><br />
text before 3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/35579">@Abc@</a></p>
<p dir="auto">into this:<br />
text before Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25;<br />
text before (Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25)<br />
text before (3Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25)<br />
text before 3Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25;</p>
<ol start="2">
<li>Thank you <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a>  for this real masterpiece!I could never have done that. I have to study more. I really like the accurate way you work, and this pushed me also to be more accurate. I have actually never thought that I am so sloppy until now. This makes me work more on my regex cases and when I have some more time to work on it I will just come back to you soon enough. So thank you for this  and have a nice day today! I go back to study some more.<br />
Dumitru.</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/67124</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67124</guid><dc:creator><![CDATA[Dumitru S.]]></dc:creator><pubDate>Thu, 17 Jun 2021 14:35:33 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Wed, 16 Jun 2021 01:05:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/21902">@dumitru-s</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@peterjones</a> and <strong>All</strong>,</p>
<p dir="auto">OK ! So, the way to achieve your problem has <strong>not</strong> changed : once the strings are <strong>well</strong> identified, with an <strong>appropriate</strong> search regex, we <strong>re</strong>-copy the <strong>key</strong> string ( <strong><code>Abc</code></strong> ), <strong>right after</strong> each string.</p>
<p dir="auto">However, as we cannot rely on the <strong>end</strong> of line location, we must locate this <strong>key</strong> string, in a <strong>unique</strong> way. I chose the <strong>temporary</strong> sequence <strong><code>@Abc@</code></strong></p>
<hr />
<p dir="auto">So, starting with this text, ( <strong>manually</strong> ! ) extracted from your picture :</p>
<pre><code class="language-diff">fermentum (Abc 22:51). Mauris fringilla et massa (3Ab 24:51, 53; 3Ab 24:51,53) eget congue
frigilla, Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25; malesuada
nisi a turpis Abc 1:9, 22-23; 3Ab 1:22-23, 9 efficitur.
lorem vehicula, 3Abc 1:12-23, 24-25 venelactis lectus
at ullamcorper (Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25). Integer arcu
Abc 22:51 Lorem ipsum 
fermentum (Abc 22:51). Mauris fringilla et massa (3Ab 24:51, 53; 3Ab 24:51,53) eget congue
a turpis (3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25). Praesent consectetur
vitae quam 3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25; at ullamcorper.
</code></pre>
<p dir="auto">I’ll express the regexes with the <strong>free-spacing</strong> mode, for a <strong>better</strong> readability. In this mode, any <strong>space</strong> char is <strong>not</strong> part of the regex ( Use <strong><code>\x20</code></strong> or <strong>escape</strong> the <strong>space</strong> char with <strong><code>\</code></strong>, to search for a <strong>space</strong> char ! )</p>
<p dir="auto">However, note that this mode is <strong>not</strong> available for the <strong>replacement</strong> regex !</p>
<p dir="auto">So, this <strong>first</strong> regex S/R :</p>
<ul>
<li>
<p dir="auto">Looks for the <strong>correct</strong> strings needing <strong>modifications</strong></p>
</li>
<li>
<p dir="auto"><strong>Inserts</strong> the key word <strong><code>Abc</code></strong>, surrounded by <strong><code>@</code></strong> chars, at the <strong>end</strong> of each string :</p>
</li>
</ul>
<p dir="auto">SEARCH  <strong><code>(?x-i) (?&lt;=\x20) \(? (\d+)? ( \u\l+ ) ( \x20 \d+ : \d+ \l? (- \d+ \l? )? ( ,\x20 \d+ (- \d+)? )? [;)] ) {2,}</code></strong></p>
<p dir="auto">REPLACE <strong><code>$0@\2@</code></strong></p>
<p dir="auto">and gives this <strong>changed</strong> text :</p>
<pre><code class="language-diff">fermentum (Abc 22:51). Mauris fringilla et massa (3Ab 24:51, 53; 3Ab 24:51,53) eget congue
frigilla, Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;@Abc@ malesuada
nisi a turpis Abc 1:9, 22-23; 3Ab 1:22-23, 9 efficitur.
lorem vehicula, 3Abc 1:12-23, 24-25 venelactis lectus
at ullamcorper (Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)@Abc@. Integer arcu
Abc 22:51 Lorem ipsum 
fermentum (Abc 22:51). Mauris fringilla et massa (3Ab 24:51, 53; 3Ab 24:51,53) eget congue
a turpis (3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)@Abc@. Praesent consectetur
vitae quam 3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;@Abc@ at ullamcorper.
</code></pre>
<p dir="auto">You probably noticed that some parts like :</p>
<ul>
<li>
<p dir="auto"><strong><code>(3Ab 24:51, 53; 3Ab 24:51,53)</code></strong>, already in its <strong>final</strong> state</p>
</li>
<li>
<p dir="auto"><strong><code>Abc 22:51</code></strong>, <strong>beginning</strong> the line</p>
</li>
<li>
<p dir="auto"><strong><code>3Abc 1:12-23, 24-25</code></strong> being a <strong>one</strong> -section string</p>
</li>
</ul>
<p dir="auto">are <strong>correctly</strong> ignored by the <strong>search</strong> regex !</p>
<hr />
<p dir="auto">Now, the <strong>second</strong> regex S/R :</p>
<ul>
<li>
<p dir="auto">Looks for any <strong><code>;</code></strong> character, <strong>not</strong> at <strong>end</strong> of each expression, and <strong>replace</strong> it with a <strong><code>;</code></strong> char, followed with a <strong>space</strong> char and the <strong>key</strong> word <strong><code>Abc</code></strong></p>
</li>
<li>
<p dir="auto">And, at <strong>end</strong> of each string, <strong>deletes</strong> the <strong>temporary</strong> string <strong><code>@Abc@</code></strong></p>
</li>
</ul>
<p dir="auto">SEARCH <strong><code>(?x-is) ; (?= .+ [;)] @ ( \u\l+ ) @ ) | @ .+? @</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1;\x20\1</code></strong></p>
<p dir="auto">Giving your <strong>expected</strong> text :</p>
<pre><code class="language-diff">fermentum (Abc 22:51). Mauris fringilla et massa (3Ab 24:51, 53; 3Ab 24:51,53) eget congue
frigilla, Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25; malesuada
nisi a turpis Abc 1:9, 22-23; 3Ab 1:22-23, 9 efficitur.
lorem vehicula, 3Abc 1:12-23, 24-25 venelactis lectus
at ullamcorper (Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25). Integer arcu
Abc 22:51 Lorem ipsum 
fermentum (Abc 22:51). Mauris fringilla et massa (3Ab 24:51, 53; 3Ab 24:51,53) eget congue
a turpis (3Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25). Praesent consectetur
vitae quam 3Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25; at ullamcorper.
</code></pre>
<hr />
<p dir="auto">As usual, <strong>tick</strong>, preferably, the <strong><code>Wrap around</code></strong> option and select the <strong><code>Regular expression</code></strong> search <strong>mode</strong></p>
<p dir="auto">Note also that the <strong>key</strong>-words can be <strong>different</strong> for <strong>each</strong> string ( <strong><code>Abc</code></strong>, <strong><code>Abcdef</code></strong>, <strong><code>3Ztest</code></strong>, <strong><code>456Test</code></strong>, … )</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67072</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67072</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 16 Jun 2021 01:05:41 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Tue, 15 Jun 2021 15:30:59 GMT]]></title><description><![CDATA[<p dir="auto">You are right. I did not realized I was not very accurate. Thank you for your honest comment.</p>
<p dir="auto">By the way, I downloaded some books that I found checking out your link <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. I already started to learn from the sites provided by you, but I would really like to know it better. So, thank you.</p>
<ul>
<li>
<p dir="auto"><em>As shown in the picture below, what I need is to find this:</em><br />
Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;<br />
(Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<br />
(3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25)<br />
3Abc 2:5a; 24:51d, 53; 1:9b, 22-23; 1:22-23c, 9; 1:22-23, 24-25;</p>
</li>
<li>
<p dir="auto"><em>and to be replaced with this:</em><br />
Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25;			<br />
(Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25)		<br />
(3Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25)<br />
3Abc 2:5a; Abc 24:51d, 53; Abc 1:9b, 22-23; Abc 1:22-23c, 9; Abc 1:22-23, 24-25;</p>
</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1623770161321-np.png" alt="NP++.png" class=" img-fluid img-markdown" /></p>
<ul>
<li>As <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a>  said both steps work very well, and it was just as he said. Also, the first regex is indeed not restrictive enough. As an example, you can see how it goes all the way to the end of the paragraph, as shown in  the picture below:</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1623770848587-np.png" alt="np++.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I hope this time I was much more accurate, and that I do show that I am willing to learn.</p>
<p dir="auto">Have a good day!<br />
Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67058</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67058</guid><dc:creator><![CDATA[Dumitru S.]]></dc:creator><pubDate>Tue, 15 Jun 2021 15:30:59 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Mon, 14 Jun 2021 20:29:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/21902">@Dumitru-S</a> ,</p>
<p dir="auto">You’ll notice that <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> had to make guesses, and wasn’t able to guess right.  Do you know why this is?  Because you gave one line of text which should match, and that was it.  The regex you had tried helped give insight into your difficulty – so thank you for sharing that – but that’s not enough.</p>
<p dir="auto">Read and take to heart the advice below.  It will get you better answers in the future.  The better you describe what you have and what you want (with good examples), the better our answers will be.</p>
<p dir="auto">----</p>
<p dir="auto"><em>Do you want regex search/replace help?  Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you.  All example text should be marked as literal text using the <code>&lt;/&gt;</code> toolbar button or manual <a href="https://community.notepad-plus-plus.org/topic/14262/how-to-markdown-code-on-this-forum/4">Markdown syntax</a>. To make <code>regex in red</code> (and so they keep their special characters like *), use backticks, like <code>`^.*?blah.*?\z`</code>. Screenshots can be pasted from the clipboard to your post using <code>Ctrl+V</code> to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have <strong>and</strong> the text you want to get from that data; include examples of things that <strong>should match</strong> and be transformed, <strong>and</strong> things that <strong>don’t match</strong> and should be left alone; show <strong>edge cases</strong> and make sure you examples are as <strong>varied</strong> as your real data.  Show the regex you already tried, <strong>and why</strong> you thought it should work; tell us what’s wrong with what you <strong>do</strong> get. Read the official <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">NPP Searching / Regex docs</a> and the forum’s <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/67027</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67027</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 14 Jun 2021 20:29:23 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Mon, 14 Jun 2021 20:24:11 GMT]]></title><description><![CDATA[<p dir="auto">Yes. Both steps work very well, and it was just as you said. Also,  the first regex is indeed not restrictive enough – if there is another word or another sentence after that, this regex captures it all all the way until CR/LF that mark the end of the paragraph.<br />
Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67026</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67026</guid><dc:creator><![CDATA[Dumitru S.]]></dc:creator><pubDate>Mon, 14 Jun 2021 20:24:11 GMT</pubDate></item><item><title><![CDATA[Reply to Interrupted list on Mon, 14 Jun 2021 21:43:47 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/21902">@dumitru-s</a> and <strong>All</strong>,</p>
<p dir="auto">I think it would be good to use <strong>two successive</strong> steps :</p>
<p dir="auto"><strong>1)</strong> Identify the lines where a <strong>replacement</strong> must occur ( String beginning with an <strong>upper</strong>-case letter followed with some <strong>lower</strong>-case letters, <strong>not</strong> at the <strong>very start</strong> of current line and followed with a <strong>space</strong> and some <strong>digit</strong> characters</p>
<p dir="auto"><strong>2)</strong> Replace any <strong><code>;</code></strong> character with the <strong>same</strong> <strong><code>;</code></strong>, followed with a <strong>space</strong> char and the <strong>first</strong> word <strong>beginning</strong> the line, after the <strong>leading space</strong> characters</p>
<hr />
<ul>
<li>
<p dir="auto">First, I advice you to <strong>backup</strong> the file(s), involved in the future <strong>replacements</strong> ;-))</p>
</li>
<li>
<p dir="auto">Then, use this <strong>first</strong> regex S/R, which <strong>re-</strong> copies the <strong>key</strong>-word at the <strong>very end</strong> of <strong>curent</strong> line after the <strong>last</strong> <strong><code>;</code></strong> character</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-is)(?!^)(\u\l+)(?=\x20\d+).+</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>$0\1</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">Just <strong>tell</strong> me if this regex seems to be <strong>not restrictive</strong> enough and matches something else, which is <strong>unwanted</strong> !</p>
<hr />
<ul>
<li>
<p dir="auto">Now, if this <strong>first</strong> step is OK, use this <strong>second</strong> regex S/R, below, which :</p>
<ul>
<li>
<p dir="auto">Adds, <strong>after</strong> any <strong>;</strong> char, except the <strong>last</strong> one, on the <strong>appropriate</strong> lines, a <strong>space</strong> char and the <strong>first</strong> word, beginning the line after the <strong>leading space</strong> chars</p>
</li>
<li>
<p dir="auto">Deletes the <strong>temporary first</strong> word, located <strong>after</strong> the <strong>last</strong> <strong><code>;</code></strong> character</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-is);(?=.+;(\u\l+)$)|\u\l+$</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>?1;\x20\1</code></strong></p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p dir="auto">If <strong>OK</strong>, I could give you some <strong>explanations</strong> on these <strong>regex</strong> S/R, next time !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/67023</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/67023</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 14 Jun 2021 21:43:47 GMT</pubDate></item></channel></rss>