<?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[Macro for Open, Find and Replace and Save]]></title><description><![CDATA[<p dir="auto">Good morning experts :)<br />
Can this thing be done using macros?</p>
<p dir="auto">It was very difficult to just open the file, and even less  for find and replace using RegEX and then save it.</p>
<p dir="auto">In the user manual it looks so easy, that before the failure to execute the macro one thinks <em>“That’s so good they don’t give so much! :¬)”</em></p>
<p dir="auto">The file I want to edit is the UDL hmgui.xml in the notepad++\UserDefineLangs folder.</p>
<p dir="auto">The search and replace strings:</p>
<blockquote>
<p dir="auto">Search:   (?s)(&lt;St)(.<em>)(/S)(.</em>)(&lt;Xt)(.<em>)(/X)|(&lt;Xt)(.</em>)(/X)(.<em>)(&lt;St)(.</em>)(/S)<br />
Replace:  ?1\5\2\7\4\1\6\3:${12}${9}${14}${11}${8}${13}${10}</p>
</blockquote>
<p dir="auto">I reviewed the documentation in Macros and Configuration of the user manual, as well as the links, to Scintilla ( Scintilla.iface.) and (menuCmdID.h,) but the truth is that it is too big for me given my capacity or experience.</p>
<p dir="auto">The only thing I could do was change an “a” to a “b” via macro. :)ⁿ</p>
<p dir="auto">Any suggestion is welcome.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23732/macro-for-open-find-and-replace-and-save</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 19:09:59 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23732.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Nov 2022 15:42:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Wed, 16 Nov 2022 13:56:23 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> said in <a href="/post/81349">Macro for Open, Find and Replace and Save</a>:</p>
<blockquote>
<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: josé-luis-montero-castellanos">@<bdi>josé-luis-montero-castellanos</bdi></a>, @aln-kilborn and <strong>all</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: josé-luis-montero-castellanos">@<bdi>josé-luis-montero-castellanos</bdi></a>, regarding your <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?s)(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S)</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>?1\5\2\7\4\1\6\3:${12}${9}${14}${11}${8}${13}${10}</code></strong></p>
</li>
</ul>
<p dir="auto">Why do you need the <strong>leading</strong> in-line modifier <strong><code>(?s)</code></strong>, in the <strong>search</strong> part ? Do you mean that the <strong>single</strong> char <strong><code>.</code></strong> in group <strong><code>2</code></strong>, <strong><code>4</code></strong>, <strong><code>6</code></strong>, <strong><code>9</code></strong>, <strong><code>11</code></strong> and <strong><code>13</code></strong> may also represent a <strong>line-break</strong> char ( <strong><code>\r</code></strong> or <strong><code>\n</code></strong> ) ?</p>
<p dir="auto">I suppose not ! Then, your correct <strong>search</strong> regex is rather :</p>
<p dir="auto"><strong><code>(?-s)(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S)</code></strong></p>
<p dir="auto">where any <strong><code>.</code></strong> <strong>single</strong> char will represent a <strong>non-break</strong> char, <strong>only</strong> !</p>
<hr />
<p dir="auto">Now, I noticed that the groups used, in <strong>replacement</strong>, for <strong>each</strong> alternative of the <strong>search</strong> regex, are in the <strong>same</strong> order ! Then, you can use, preferably, a <strong>specific</strong> feature of the <strong>Boost Regex</strong> engine, called <strong><code>Branch Reset</code></strong></p>
<p dir="auto">For instance, in your regex, the <strong>numbers</strong> of <strong>each</strong> group are :</p>
<pre><code class="language-diff">(?-s)(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S)
Gr : 1    2  3   4  5    6  7   |8    9  10  11 12   13 14  
</code></pre>
<p dir="auto">If we use the <strong><code>Branch Reset</code></strong> feature the <strong>search</strong> regex becomes :</p>
<pre><code class="language-diff">(?-s)(?|(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S))
Gr:     1    2  3   4  5    6  7   |1    2  3   4  5    6  7
</code></pre>
<p dir="auto">Thus, your entire regex S/R can be <strong>simplified</strong> as below :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-s)(?|(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S))</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\5\2\7\4\1\6\3</code></strong></p>
</li>
</ul>
<hr />
<p dir="auto">For instance, given this <em>INPUT</em> text :</p>
<pre><code class="language-diff">&lt;St2/S4&lt;Xt6/X
&lt;Xt9/XB&lt;StD/S
</code></pre>
<p dir="auto">You would get the <em>OUTPUT</em> text, below :</p>
<pre><code class="language-diff">&lt;Xt2/X4&lt;St6/S
&lt;St9/SB&lt;XtD/X
</code></pre>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">The <strong><code>Regular expression</code></strong> option must be <strong>selected</strong></p>
</li>
<li>
<p dir="auto">Preferably, <strong>tick</strong> the <strong><code>[Wrap around](https://www.ahijoy.com/)</code></strong> option</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
</blockquote>
<p dir="auto">I tried it but didn’t work</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81522</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81522</guid><dc:creator><![CDATA[Jaguar Asad]]></dc:creator><pubDate>Wed, 16 Nov 2022 13:56:23 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Sat, 12 Nov 2022 23:14:59 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 />
I will take your comments into account.<br />
Greetings :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81415</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81415</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Sat, 12 Nov 2022 23:14:59 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Sat, 12 Nov 2022 22:53:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a> ,</p>
<p dir="auto">I understood what you meant, without needing to delete, especially once I realized that you weren’t speaking as if with broken english , but rather because you <strong>ARE</strong> using a translator, which are not as good at translating your language using the nuances an english speaking person is used to. I realize, with the few languages I have some familiarity with, that most foreign (to English speakers) languages don’t have the same directness or ability for description that English allows speakers, so even though your tranlator seems to be working good from your end…it has a few failings on our end…and at first, I wasn’t sure if it was your personal lack of a wider understanding of English, or if you were using a translator, which can’t compare to the language usage. :)</p>
<p dir="auto">Now that we know the issue, we at least can understand now, that it wasn’t your statements, but that of a translator’s inability to properly relay your meaning. :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81414</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81414</guid><dc:creator><![CDATA[Lycan Thrope]]></dc:creator><pubDate>Sat, 12 Nov 2022 22:53:05 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Sat, 12 Nov 2022 14:47:22 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 />
Greetings:</p>
<p dir="auto">I edited this post, (deleting the previous one, since the editing time had passed.) highlighting the parts that were changed or added that could be misinterpreted…</p>
<blockquote>
<p dir="auto">just didn’t want to see the different lanuages we speak, become a problem in our communications. :-)</p>
</blockquote>
<p dir="auto">By the way, my Qtranslator works great, I’m a Spanish speaker (greetings from Colombia, remember?). But that <strong>if I were</strong> to blame the translator it would be dishonest <strong>on my side,</strong> and of low esteem on my part, because I too have much to complain about and point out, but I reserve that for the efficient running of the forum. Wasn’t what seemed offensive really a mockery of myself? (3 or 4 times in this thread) (a good preventative habit against hubris!).</p>
<p dir="auto">About python, well I have no choice, and your suggestion is very appropriate, I think <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> also mentioned it. <strong>I’ll give it a try.</strong>  Or I could program it in some language that I know.</p>
<p dir="auto">Well, opening a file and changing four words is not a “feat” that requires a lot of code. :)</p>
<p dir="auto">Closing! - Have a good evening…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81397</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81397</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Sat, 12 Nov 2022 14:47:22 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Fri, 11 Nov 2022 19:22:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a> ,</p>
<p dir="auto">I suggested the Python option because I’m not quite sure changing the files contents would be able to effectively be changed and reloaded simply by using the regex, because essentially the file has to be saved, I believe, to be implemented, but after thinking about it, I remember that changing the User Defined Language keyword and stylers would interactively change them in real time, so in hindsight, you might be on to something.</p>
<p dir="auto">The Python option was suggested because even though I’m not good at it, it seems that the stuff that <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> has posted that I’ve seen goes to the heart of using the Scintilla directly via NPP, so the changes would be able to be changed real time, is what I was figuring…so I may have been wrong to suggest that in light of the possiblity you point out.  I’m not that involved in the actual code that runs NPP, so I’m more of a user seeking more advanced abilities of my language without needing to learn to code NPP itself…and Python plugin was the closest thing I cold think of short of actual NPP coding that might be able to accomplish the task you had in mind.</p>
<p dir="auto">So in closing, good luck with your experimentation. I hope it proves usable as I’d like to not have to do the multiple steps to change from Light mode to Dark Mode as well.  I just didn’t want to see the different lanuages we speak, become a problem in our communications. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81380</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81380</guid><dc:creator><![CDATA[Lycan Thrope]]></dc:creator><pubDate>Fri, 11 Nov 2022 19:22:52 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Fri, 11 Nov 2022 17:56:49 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 />
Hello:<br />
The idea is that if I’m going to use Npp, it’s natural that I want to take advantage of its resources without resorting to a new learning curve. That’s why the natural option seemed to me to be the Npp macros.</p>
<p dir="auto">With respect to</p>
<pre><code>So let’s not make it worse by making more assumptions
</code></pre>
<p dir="auto">I like that smile :), with which the comment ends, And the comment itself,  I subscribe.</p>
<p dir="auto">Have a a Good Day and success.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81375</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81375</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Fri, 11 Nov 2022 17:56:49 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Fri, 11 Nov 2022 17:17:16 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><br />
Good morning - Thanks for your kind reply:</p>
<p dir="auto">I forgot to mention that the RegEx that I made, not only deactivates one section while activating the other, and <code>vice versa</code>, that is, it alternates (toggles) between the two modes or serves as a <strong>“selector”</strong> that is why the <code>?1</code> as a conditional selector which means that if capturing group 1 matches the first part of the toggle is <strong>replaced</strong>, if not then the second.</p>
<p dir="auto"><code>?ℕYesPattern:NoPattern</code> (from the user manual).</p>
<p dir="auto">It all boils down to changing the tags positions (part of them)  <code>&lt;St</code>yle&gt;, <code>&lt;/S</code>tyle&gt;,<code>&lt;Xt</code>yle&gt;, <code>&lt;/X</code>tyle&gt; (the spaces in the previous tags are effect of the ` character).</p>
<p dir="auto">Regarding your suggestions, I haven’t tried it yet, but I’m about to do it. The first thing to see in detail each expression and understand its purpose.  It <em>seems elegant and obviously more understandable (digestible)</em> especially with the use of <code>(?x)</code>. (Don’t forget I’m new to Npp and its RegEX engine.) Although I already knew something about RegEx.</p>
<p dir="auto">As soon as I have tested the functionality, and deduced that it can be useful to me, I will tell you.</p>
<p dir="auto">Have a good day :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81373</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81373</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Fri, 11 Nov 2022 17:17:16 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Mon, 14 Nov 2022 23:00:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: josé-luis-montero-castellanos">@<bdi>josé-luis-montero-castellanos</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</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, I do understand the <strong>regex</strong> problem ;-))</p>
<p dir="auto">I thought about a very <strong>simple</strong> way to achive it !</p>
<p dir="auto">To verify my <strong>assumption</strong>, I made a test with the <strong><code>markdown._preinstalled.udl.xml</code></strong> file, within the <strong><code>UserDefineLangs</code></strong> folder</p>
<ul>
<li>
<p dir="auto">First, I copied this file with a <strong>new</strong> name <strong><code>markdown._new.udl.xml</code></strong>, left in the <strong><code>UserDefineLangs</code></strong> folder, too</p>
</li>
<li>
<p dir="auto">I opened this <strong>new</strong> file and change the line below, accordingly :</p>
</li>
</ul>
<pre><code class="language-xml">    &lt;UserLang name="Markdown (new)" ext="md markdown" udlVersion="2.1"&gt;
</code></pre>
<ul>
<li>Then, before the line <strong><code>&lt;Styles&gt;</code></strong>, I inserted the <strong>comment</strong> line <strong><code>&lt;!-- Light mode --&gt;</code></strong> giving :</li>
</ul>
<pre><code class="language-xml">        &lt;!-- Light mode --&gt;
        &lt;Styles&gt;
</code></pre>
<ul>
<li>
<p dir="auto">I copied <strong>all</strong> the <strong><code>&lt;Styles&gt;......&lt;/styles</code></strong>  section</p>
</li>
<li>
<p dir="auto">I <strong>pasted</strong> all these lines at the <strong>end</strong> of the <strong><code>markdown._new.udl.xml</code></strong> file</p>
<ul>
<li>
<p dir="auto">Preceded with a <strong>comment</strong> line <strong><code>&lt;!-- Dark mode --&gt;</code></strong></p>
</li>
<li>
<p dir="auto">Followed with the <strong>two</strong> final lines <strong><code>&lt;/userLang&gt;</code></strong> and <strong><code>&lt;/NotepadPlus&gt;</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">=&gt; So, the <strong>final</strong> contents of the <strong><code>markdown._new.udl.xml</code></strong> file are :</p>
<pre><code class="language-xml">&lt;!--//
Markdown-plus-plus is a project to support Markdown syntax in Notepad++.
All UDLs are carefully designed by human, rather than generated by machine.

Want an UDL for different theme?
Want to change its preference?
Want to create your own?
Go get it: https://github.com/Edditoria/markdown-plus-plus

Please read the README file for details.
Welcome issues and pull requests via the above link.

Copyright (c) Edditoria. Open source under the MIT license:
https://github.com/Edditoria/markdown-plus-plus/blob/master/LICENSE.txt
//--&gt;
&lt;NotepadPlus&gt;
    &lt;UserLang name="Markdown (new)" ext="md markdown" udlVersion="2.1"&gt;
        &lt;Settings&gt;
            &lt;Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="2" decimalSeparator="0" /&gt;
            &lt;Prefix Keywords1="yes" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="yes" Keywords6="yes" Keywords7="yes" Keywords8="no" /&gt;
        &lt;/Settings&gt;
        &lt;KeywordLists&gt;
            &lt;Keywords name="Comments"&gt;00# 01 02((EOL)) 03&amp;lt;!-- 04--&amp;gt;&lt;/Keywords&gt;
            &lt;Keywords name="Numbers, prefix1"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Numbers, prefix2"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Numbers, extras1"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Numbers, extras2"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Numbers, suffix1"&gt;.&lt;/Keywords&gt;
            &lt;Keywords name="Numbers, suffix2"&gt;.&lt;/Keywords&gt;
            &lt;Keywords name="Numbers, range"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Operators1"&gt;@ &amp;lt; &amp;gt; \&amp;lt; \&amp;gt; \\ \` \* \_ \{ \} \[ \] \( \) \# \+ \- \. \! \~ \| |:-: |:--: |:---: | :-: :--: :---: :|: |: :|&lt;/Keywords&gt;
            &lt;Keywords name="Operators2"&gt;- + :- :-- :--- :&lt;/Keywords&gt;
            &lt;Keywords name="Folders in code1, open"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in code1, middle"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in code1, close"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in code2, open"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in code2, middle"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in code2, close"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in comment, open"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in comment, middle"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Folders in comment, close"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Keywords1"&gt;http:// (http:// https:// (https:// mailto: (mailto: ftp:// (ftp:// ftps:// (ftps:// (/ /&lt;/Keywords&gt;
            &lt;Keywords name="Keywords2"&gt;==== ----&lt;/Keywords&gt;
            &lt;Keywords name="Keywords3"&gt;*** ___&lt;/Keywords&gt;
            &lt;Keywords name="Keywords4"&gt;** __&lt;/Keywords&gt;
            &lt;Keywords name="Keywords5"&gt;* _&lt;/Keywords&gt;
            &lt;Keywords name="Keywords6"&gt;** __&lt;/Keywords&gt;
            &lt;Keywords name="Keywords7"&gt;* _&lt;/Keywords&gt;
            &lt;Keywords name="Keywords8"&gt;&lt;/Keywords&gt;
            &lt;Keywords name="Delimiters"&gt;00![ 00[ 01\ 02] 02] 03``` 03` 03~~~ 04\ 05``` 05((EOL `)) 05~~~ 06*** 07\ 08((EOL ***)) 09** 10\ 11((EOL **)) 12* 13\ 14((EOL *)) 15** 16\ 17((EOL **)) 18* 19\ 20((EOL *)) 21 22 23&lt;/Keywords&gt;
        &lt;/KeywordLists&gt;
        &lt;!-- Light mode --&gt;
        &lt;Styles&gt;
            &lt;WordsStyle name="DEFAULT" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="COMMENTS" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
            &lt;WordsStyle name="LINE COMMENTS" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="NUMBERS" fgColor="0080FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS1" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS2" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS3" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS4" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS5" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS6" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS7" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS8" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="OPERATORS" fgColor="8080FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="FOLDER IN CODE1" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="FOLDER IN CODE2" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="FOLDER IN COMMENT" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS1" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS3" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS4" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="65600" /&gt;
            &lt;WordsStyle name="DELIMITERS5" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="32800" /&gt;
            &lt;WordsStyle name="DELIMITERS6" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS7" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS8" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
        &lt;/Styles&gt;
        &lt;!-- Dark mode --&gt;
        &lt;Styles&gt;
            &lt;WordsStyle name="DEFAULT" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="COMMENTS" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
            &lt;WordsStyle name="LINE COMMENTS" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="NUMBERS" fgColor="0080FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS1" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS2" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS3" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS4" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS5" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS6" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS7" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="KEYWORDS8" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="OPERATORS" fgColor="8080FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
            &lt;WordsStyle name="FOLDER IN CODE1" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="FOLDER IN CODE2" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="FOLDER IN COMMENT" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS1" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS3" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS4" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="65600" /&gt;
            &lt;WordsStyle name="DELIMITERS5" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="32800" /&gt;
            &lt;WordsStyle name="DELIMITERS6" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS7" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="3" nesting="0" /&gt;
            &lt;WordsStyle name="DELIMITERS8" fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
        &lt;/Styles&gt;
    &lt;/UserLang&gt;
&lt;/NotepadPlus&gt;
</code></pre>
<hr />
<ul>
<li>
<p dir="auto">Thus, the problem came down to the <strong>simple</strong> question : how to <strong>comment</strong> out all the <strong><code>Light Mode</code></strong> section, in <strong>one</strong> go ? As usual, <strong>regular expressions</strong> are the solution !</p>
</li>
<li>
<p dir="auto">Open or switch to the <strong><code>markdown._new.udl.xml</code></strong> file</p>
</li>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
</li>
</ul>
<pre><code class="language-diff">(?xs-i)  ^  [\t\x20]*  &lt;!--[ ]Light[ ]mode[ ]--&gt;  \R  \K  [\t\x20]*  &lt;Styles&gt;  \R  .+?  ^  [\t\x20]*  &lt;/Styles&gt;  \R  #  ( Search )

(        )&lt;!--\r\n$0(        )--&gt;\r\n
</code></pre>
<ul>
<li>
<p dir="auto"><strong>Untick</strong> all <strong>box</strong> options</p>
</li>
<li>
<p dir="auto"><strong>Tick</strong> the <strong><code>Wrap around</code></strong> option</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 <strong>once</strong> on the <strong><code>Replace All</code></strong> button ( Do <strong>not</strong> use the <strong><code>Replace</code></strong> button ! )</p>
</li>
<li>
<p dir="auto">Close the <strong>Replace</strong> dialog ( <strong><code>Esc</code></strong> )</p>
</li>
<li>
<p dir="auto">Save the <strong>new</strong> contents, relative to the <strong><code>Dark mode</code></strong></p>
</li>
<li>
<p dir="auto">After stopping and <strong>re-starting</strong> Notepad++, I did verify that this <strong>new</strong> UDL was <strong>functional</strong> and <strong>identical</strong> to the <strong><code>Mardown (Preinstalled)</code></strong> UDL</p>
</li>
</ul>
<p dir="auto">=&gt; From now on, all the <strong><code>light mode</code></strong> section is <strong>commented out</strong> between <strong>two</strong> lines <strong><code>&lt;!--</code></strong> and <strong><code>--&gt;</code></strong></p>
<p dir="auto">So, you just have to <strong>modify</strong> the <strong><code>fgcolor</code></strong> and <strong><code>bgcolor</code></strong> attibutes of the <strong><code>Dark mode</code></strong> section, as you like ;-))</p>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">The search regex uses the <strong>free-spacing</strong> mode <strong><code>(?x)</code></strong> to <strong>better</strong> identify the <strong>main</strong> parts of the <strong>search</strong> regex</p>
</li>
<li>
<p dir="auto">When the <strong><code>(?x)</code></strong> <strong>modifier</strong> is used, the <strong>search</strong> regex may lie on <strong>one</strong> or <strong>several</strong> lines</p>
</li>
</ul>
<p dir="auto">For instance, my <strong>previous</strong> <strong><code>single-line</code></strong> regex :</p>
<pre><code class="language-diff">(?xs-i)  ^  [\t\x20]*  &lt;!--[ ]Light[ ]mode[ ]--&gt;  \R  \K  [\t\x20]*  &lt;Styles&gt;  \R  .+?  ^  [\t\x20]*  &lt;/Styles&gt;  \R  #  ( Search )
</code></pre>
<p dir="auto">Could also be expressed as :</p>
<pre><code class="language-diff">(?xs-i)                        #  FREE-SPACING (x) , SINGLE-LINE (s) , SENSIBLE to CASE (-i)  ( 'in-line' modifiers )
^  [\t\x20]*                   #  ANY range of leading SPACE or TABULATION characters, possibly NULL, at BEGINNING of CURRENT line
&lt;!--[ ]Light[ ]mode[ ]--&gt;  \R  #  String '&lt;!-- Light mode --&gt;' with that EXACT case and the LINE-BREAK chars  ( \R )
\K                             #  Resets any MATCHED text, so far and resets the REGEX ENGINE position to 0
[\t\x20]*                      #  ANY range of leading SPACE or TABULATION characters, possibly NULL, at BEGINNING of CURRENT line
&lt;Styles&gt;  \R                   #  String '&lt;Styles&gt;' with that EXACT case and the LINE-BREAK chars ( \R )
.+?                            #  The SHORTEST NON-NULL range of ANY char ( standard or EOL ) till...
^  [\t\x20]*                   #  ANY range of leading SPACE or TABULATION characters, possibly NULL, at BEGINNING of CURRENT line
&lt;/Styles&gt;  \R                  #  String '&lt;/Styles&gt;' with that EXACT case and the LINE-BREAK chars ( \R )
</code></pre>
<ul>
<li>
<p dir="auto">In this mode, <strong><code>space</code></strong> and <strong><code>line-break</code></strong> chars are <strong>never</strong> part of the regex <em>AND</em> anything after a <strong>first</strong> <strong><code>#</code></strong> character is a <strong>comment</strong>. Thus :</p>
<ul>
<li>
<p dir="auto">Any <strong><code>space</code></strong> character, part of the regex, must be changed as <strong><code>[ ]</code></strong> or <strong><code>\x20</code></strong> or <strong>preceded</strong> with an <strong>anti-slash</strong> <strong><code>\</code></strong></p>
</li>
<li>
<p dir="auto">Any <strong><code>#</code></strong> character, part of the regex, must be changed as <strong><code>[#]</code></strong> or <strong><code>\x23</code></strong> or <strong>preceded</strong> with an <strong>anti-slash</strong> <strong><code>\ </code></strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">Note that the appropriate <strong>replacement</strong> regex <strong>cannot</strong> benefit from the <strong><code>(?x)</code></strong> mode. So <strong>all</strong> its text is necessarily <strong>linked</strong> in <strong>one</strong> (possibly <strong>long</strong> ) line</p>
</li>
</ul>
<pre><code class="language-diff">(        )&lt;!--\r\n$0(        )--&gt;\r\n
</code></pre>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81368</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81368</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 14 Nov 2022 23:00:13 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Fri, 11 Nov 2022 01:34:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a> ,</p>
<p dir="auto">It’s the language, obviously.  It made me wonder if you were being insulting or not, also, the way it was phrased.  So let’s not make it worse by making more assumptions. :)  I like your idea, so using the Python Plugin might be a good vehicle for you to try and implement it, but it has to be worth the needed learning and time to be worth it to you. We only work on stuff when not getting paid, because we are  interested or passionate about it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81367</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81367</guid><dc:creator><![CDATA[Lycan Thrope]]></dc:creator><pubDate>Fri, 11 Nov 2022 01:34:55 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 21:28:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a></p>
<pre><code> Can’t you just accept that it WAS unclear?
</code></pre>
<p dir="auto">I don’t want to insult your intelligence by asking you to clarify what this part of my answer means.</p>
<p dir="auto">Nebulous? Maybe, <strong>I give you the credit!!!.</strong>*</p>
<p dir="auto">And  maybe means that anyone involved could be right.  Or not?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81364</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81364</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Thu, 10 Nov 2022 21:28:29 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 21:51:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello, thank you for your support:<br />
As I put it, the search and replace function or deciphering its function is not my problem, but to put each of the functions (open file, replace text and save) into a <em>“notepad++ macro”.</em></p>
<p dir="auto">Anyway I’m going to pass you the part where I thought to use it.</p>
<pre><code>&lt;Styles mode="lght"&gt;
	&lt;WordsStyle name="DEFAULT"  ... fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
	&lt;WordsStyle name="COMMENTS" ... fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
	&lt;WordsStyle name="LINE COMME... fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
	.
	.
	.
&lt;/Styles&gt;                       ...
&lt;Xtyles mode="dark"&gt;            ...
	&lt;WordsStyle name="DEFAULT"  ... fgColor="333333" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" /&gt;
	&lt;WordsStyle name="COMMENTS" ... fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" nesting="0" /&gt;
	&lt;WordsStyle name="LINE COMME... fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" /&gt;
	.
	.
	.
&lt;/Xtyles&gt;
&lt;/UserLang&gt;
</code></pre>
<p dir="auto">The purpose is to change a &lt;Style&gt; tag and its &lt;/Style&gt; pair to the tags, &lt;Xtyle&gt; and &lt;/Xtyle&gt; by enabling the “dark mode” section and disabling the “light mode” section thinking the UDL won’t do case of the &lt;Xtype&gt; tag.</p>
<p dir="auto"><code>(?s)</code> is because <code>.*</code> must include many lines of text along with their line breaks.<br />
The other weird function is <code>?1</code> in the replacement string making it a <em>conditional selector.</em><br />
Well I’m studying the user manual in the RegEX section and Npp is fabulous at that.<br />
I haven’t experienced your notes yet, but right now I’m getting ready to do so…<br />
Cheers…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81363</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81363</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Thu, 10 Nov 2022 21:51:27 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 21:11:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a> ,</p>
<blockquote>
<p dir="auto">You already said the answer: NO! .</p>
</blockquote>
<p dir="auto">The <em>short</em> version is no.</p>
<blockquote>
<p dir="auto">Answer? NO. Nothing more to say.</p>
</blockquote>
<p dir="auto">Actually, no, that’s not true.  There was more to say, because there are alternatives.  And my post where I said the unambiguous “no”, I also gave one of those alternatives.</p>
<blockquote>
<p dir="auto">Let’s go to the title: … And after a courteous greeting, comes something essential:</p>
</blockquote>
<p dir="auto">You trying to justify your phrasing or us trying to justify our interpretation or difficulty understanding is rather irrelevant at this point.  It won’t help you or us going forward.</p>
<p dir="auto">Going forward, understand that it’s generally considered polite to include <em>all</em> the essential details in the post body, not spread across the title and the body.  (Titles are too small for helpers to gain any useful information, so many don’t even pay much attention to the title, assuming that all the critical information will be in the body.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81362</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81362</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 10 Nov 2022 21:11:53 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 21:06:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a> said in <a href="/post/81359">Macro for Open, Find and Replace and Save</a>:</p>
<blockquote>
<p dir="auto">Let’s go to the title:<br />
Macro for Open, Find and Replace and Save</p>
<p dir="auto">And after a courteous greeting, comes something essential:<br />
Can this thing be done using macros?</p>
<p dir="auto">(Which thing? ) = “Macro for Open, Find and Replace and Save!!!” (the title)  be done using macros??? (the opening sentence after the salutation, the essential preamble)<br />
Answer? NO. Nothing more to say.<br />
Nebulous? Maybe, I give you the credit.</p>
</blockquote>
<p dir="auto">Why do you persist with this when the two (perhaps three) top posters on this site, that have helped decipher the needs of many, many people asking questions for many years, judged your original post to be unclear?  Can’t you just accept that it WAS unclear?</p>
<p dir="auto">Do more people have to post and agree with that, before you change your attitude and stop with the refutations?  Your position looks worse each time you post; sad.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81360</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81360</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 10 Nov 2022 21:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 20:53:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a><br />
Thanks for your reply:<br />
If a macro can’t open a file, I have to find a different solution.<br />
You already said the answer: NO! .</p>
<p dir="auto">Let’s go to the title:</p>
<pre><code>Macro for Open, Find and Replace and Save
</code></pre>
<p dir="auto">And after a courteous greeting, comes something essential:</p>
<pre><code>Can this thing be done using macros?
</code></pre>
<p dir="auto">(Which thing? ) = <em>“Macro for Open, Find and Replace and Save!!!”</em> <strong>(the title)</strong>  be done using macros??? (the opening sentence after the salutation, <em>the essential preamble)</em></p>
<p dir="auto">Answer? NO. Nothing more to say.</p>
<p dir="auto">Nebulous? Maybe, I give you the credit.<br />
Thank you anyway.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81359</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81359</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Thu, 10 Nov 2022 20:53:42 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 18:28:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a> said in <a href="/post/81347">Macro for Open, Find and Replace and Save</a>:</p>
<blockquote>
<p dir="auto">Open and Save are marked as being problematic while Find and Replace as easy.</p>
</blockquote>
<p dir="auto">In my reading of your initial post, most of your description was pretty nebulous.  And like Alan and Guy, I thought your problem was with the search-and-replace.</p>
<p dir="auto">Saying “it was very difficult just open the file” implies that you got it working eventually.  But now you say it’s “problematic”.  You still haven’t said what “problematic” means to you.</p>
<blockquote>
<p dir="auto">What the “context” says was that I couldn’t open and then save the file via macro and all I could do via macro was find and replace,</p>
</blockquote>
<p dir="auto">This is the only time you’ve been definite about your problems.</p>
<p dir="auto">It would have been so much easier for us to understand you if, in the body of your post (not just the title), you had said,<br />
“I tried to record a macro that opened a file, ran a search-and-replace, and save the file.  But the file-open and file-save portion isn’t working”</p>
<p dir="auto">As to why File Open isn’t working: the macro language only records commands that don’t require <em>any</em> user input (well, and search-and-replace, where it saves the user input as constants – it doesn’t ask you for the inputs when it runs).  But File Open <strong>requires</strong> user input, whether it’s during the recording or during the run.  So the macro language cannot implement it.</p>
<p dir="auto">As to why File Save isn’t working: my guess is the File Open just made you <em>think</em> that File Save wasn’t working.  You can record a search-and-replace-then-save just fine with the macro language.  But a Save As, because it requires user input, will not work in a macro.</p>
<p dir="auto">If you want features not available to the macro language – like loops, if/else, or user input (including File Open or Save As) – then you will need to move beyond the macro language, and use one of the scripting plugins (like PythonScript).</p>
<p dir="auto">TL;DR Summary: <strong>“File &gt; Open” and “File &gt; Save As” will not work in a macro.  Search-and-replace and “File &gt; Save” do work in a macro.</strong></p>
]]></description><link>https://community.notepad-plus-plus.org/post/81352</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81352</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 10 Nov 2022 18:28:51 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 18:14:40 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: josé-luis-montero-castellanos">@<bdi>josé-luis-montero-castellanos</bdi></a>, @aln-kilborn and <strong>all</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: josé-luis-montero-castellanos">@<bdi>josé-luis-montero-castellanos</bdi></a>, regarding your <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?s)(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S)</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>?1\5\2\7\4\1\6\3:${12}${9}${14}${11}${8}${13}${10}</code></strong></p>
</li>
</ul>
<p dir="auto">Why do you need the <strong>leading</strong> in-line modifier <strong><code>(?s)</code></strong>, in the <strong>search</strong> part ? Do you mean that the <strong>single</strong> char <strong><code>.</code></strong> in group <strong><code>2</code></strong>, <strong><code>4</code></strong>, <strong><code>6</code></strong>, <strong><code>9</code></strong>, <strong><code>11</code></strong> and <strong><code>13</code></strong> may also represent a <strong>line-break</strong> char ( <strong><code>\r</code></strong> or <strong><code>\n</code></strong> ) ?</p>
<p dir="auto">I suppose not ! Then, your correct <strong>search</strong> regex is rather :</p>
<p dir="auto"><strong><code>(?-s)(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S)</code></strong></p>
<p dir="auto">where any <strong><code>.</code></strong> <strong>single</strong> char will represent a <strong>non-break</strong> char, <strong>only</strong> !</p>
<hr />
<p dir="auto">Now, I noticed that the groups used, in <strong>replacement</strong>, for <strong>each</strong> alternative of the <strong>search</strong> regex, are in the <strong>same</strong> order ! Then, you can use, preferably, a <strong>specific</strong> feature of the <strong>Boost Regex</strong> engine, called <strong><code>Branch Reset</code></strong></p>
<p dir="auto">For instance, in your regex, the <strong>numbers</strong> of <strong>each</strong> group are :</p>
<pre><code class="language-diff">(?-s)(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S)
Gr : 1    2  3   4  5    6  7   |8    9  10  11 12   13 14  
</code></pre>
<p dir="auto">If we use the <strong><code>Branch Reset</code></strong> feature the <strong>search</strong> regex becomes :</p>
<pre><code class="language-diff">(?-s)(?|(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S))
Gr:     1    2  3   4  5    6  7   |1    2  3   4  5    6  7
</code></pre>
<p dir="auto">Thus, your entire regex S/R can be <strong>simplified</strong> as below :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-s)(?|(&lt;St)(.)(/S)(.)(&lt;Xt)(.)(/X)|(&lt;Xt)(.)(/X)(.)(&lt;St)(.)(/S))</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\5\2\7\4\1\6\3</code></strong></p>
</li>
</ul>
<hr />
<p dir="auto">For instance, given this <em>INPUT</em> text :</p>
<pre><code class="language-diff">&lt;St2/S4&lt;Xt6/X
&lt;Xt9/XB&lt;StD/S
</code></pre>
<p dir="auto">You would get the <em>OUTPUT</em> text, below :</p>
<pre><code class="language-diff">&lt;Xt2/X4&lt;St6/S
&lt;St9/SB&lt;XtD/X
</code></pre>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">The <strong><code>Regular expression</code></strong> option must be <strong>selected</strong></p>
</li>
<li>
<p dir="auto">Preferably, <strong>tick</strong> the <strong><code>Wrap around</code></strong> option</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81349</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81349</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 10 Nov 2022 18:14:40 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 16:34:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a><br />
Thanks again:<br />
First of all the title says Macro <em>Open, Save,</em> Find, Replace, And in the content <em>Open and Save</em> are marked as being problematic while <em>Find and Replace</em> as easy.</p>
<p dir="auto">Don’t mind if I laugh at myself :)ⁿ expressing how little I could do…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81347</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81347</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Thu, 10 Nov 2022 16:34:02 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 16:26:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a></p>
<p dir="auto">So your question boils down to “can I open a specific file in a macro?” as that is the first step in your described sequence.  It seems that if all of the other “context” was NOT supplied in the first posting, this would have been easier to understand.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81346</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81346</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 10 Nov 2022 16:26:27 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 16:17:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a><br />
Thanks for your reply:<br />
What the <strong>“context”</strong> says was that I couldn’t open and then save the file <code>via macro</code> and all I could do <code>via macro</code> was find and replace, and I did that to see how it was set to the file shorcuts.xml and take it as a guide for when I went to write the $(full_pathname) of the file.</p>
<p dir="auto">Now what I put in context that you points out as <code>this</code> is <em>not code or a line that should be interpreted</em> because the search and replace <em>wasn’t the problem!</em>. as it was open, select the file (or type its name in the box) and then save <code>via macro</code>.</p>
<p dir="auto">Have a nice day.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81344</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81344</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Thu, 10 Nov 2022 16:17:32 GMT</pubDate></item><item><title><![CDATA[Reply to Macro for Open, Find and Replace and Save on Thu, 10 Nov 2022 15:52:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jos%C3%A9-luis-montero-castellanos" aria-label="Profile: José-Luis-Montero-Castellanos">@<bdi>José-Luis-Montero-Castellanos</bdi></a> said in <a href="/post/81340">Macro for Open, Find and Replace and Save</a>:</p>
<blockquote>
<p dir="auto">The only thing I could do was change an “a” to a “b” via macro.</p>
</blockquote>
<p dir="auto">If you can do that, then I don’t understand why you can’t make it do a more complicated replacement.</p>
<p dir="auto">Are you saying that your replacement isn’t correct?  If so, it is hard to evaluate that since you didn’t follow the <a href="https://community.notepad-plus-plus.org/topic/22022/faq-desk-template-for-search-replace-questions">requirements for posting</a> your find and replace expressions and put them in boxes like <code>this</code>.  So this website mucked with them and we can’t tell with any real confidence what they actually are.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81342</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81342</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 10 Nov 2022 15:52:07 GMT</pubDate></item></channel></rss>