<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to unescape?]]></title><description><![CDATA[<p dir="auto">Hello!<br />
How (in NPP) to unescape all escapes (\"\r\n\t…) in the whole text (by one command)? Is it possible at all (without creating some macro by myself)?<br />
Thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/12464/how-to-unescape</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Nov 2026 13:03:13 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12464.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Oct 2016 09:36:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to unescape? on Wed, 02 Dec 2020 21:56:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/gioacchino-piazzolla" aria-label="Profile: gioacchino-piazzolla">@<bdi>gioacchino-piazzolla</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">I agree that I could have written the <strong>first</strong> regex S/R to <strong>Escape</strong> these <strong>special</strong> characters as :</p>
<p dir="auto">SEARCH <strong><code>(\a)|(\x08)|(\f)|(\n)|(\r)|(\t)|(")|(')|(\\)</code></strong></p>
<p dir="auto">REPLACE <strong><code>\\(?1a)(?2x08)(?3f)(?4n)(?5r)(?6t)(?7")(?8')(?9\\)</code></strong></p>
<p dir="auto">But , in that case, <strong>any</strong> text is changed in a <strong>one-line</strong> text. Just give it a try with the <strong><code>change.log</code></strong> or <strong><code>license.txt</code></strong>  file ! Don’t know if this syntax is <strong>expected</strong> by the OP ?</p>
<hr />
<p dir="auto">Now, I added the <strong>single quote</strong> character as I remember that the <strong><code>TextFX</code></strong> plugin can <strong>escape/unescape</strong> the <strong><code>'</code></strong> character !</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60432</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60432</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 02 Dec 2020 21:56:40 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Wed, 02 Dec 2020 21:19:57 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/60429">How to unescape?</a>:</p>
<blockquote>
<p dir="auto">\a = \x07</p>
</blockquote>
<p dir="auto">Ah yes, when I said <code>\x08</code> it was a repetitive typo.  :-(<br />
Meaning once I had the first mistake, I stopped thinking about it and just carried it on. :-( :-(</p>
<p dir="auto">More interesting (and getting the “heat” off of me…) is your use of <code>\r\n(*SKIP)(*F)</code> which appears to be intended to not replace any <code>\r\n</code> pairs in the data.  I don’t know that this is a valid thing to do.  The website the “recent” OP pointed to doesn’t do that. Similar for the <code>'</code> character.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60430</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60430</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 02 Dec 2020 21:19:57 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Wed, 02 Dec 2020 20:54:35 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/gioacchino-piazzolla" aria-label="Profile: gioacchino-piazzolla">@<bdi>gioacchino-piazzolla</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">If you work with <strong><code>Windows</code></strong> files ( <strong>line endings</strong> = <strong><code>\r\n</code></strong> ) here are <strong>two</strong> regex S/R :</p>
<ul>
<li>
<p dir="auto">The <strong>first</strong> one <strong>Escape</strong> the <strong>usual</strong> characters :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>\r\n(*SKIP)(*F)|(\a)|(\x08)|(\f)|(\n)|(\r)|(\t)|(")|(')|(\\)</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\\(?1a)(?2x08)(?3f)(?4n)(?5r)(?6t)(?7")(?8')(?9\\)</code></strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">The <strong>second</strong> one <strong>UNnescape</strong> the <strong>usual</strong> characters :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-i)\\(?:(a)|(x08)|(f)|(n)|(r)|(t)|(")|(')|(\\))</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>(?1\a)(?2\x08)(?3\f)(?4\n)(?5\r)(?6\t)(?7")(?8')(?9\\)</code></strong></p>
</li>
</ul>
</li>
</ul>
<hr />
<p dir="auto">Now, <strong>Alan</strong>, a little <strong>mistake</strong> !  <strong><code>\a</code></strong> = <strong><code>\x07</code></strong> and <strong><code>[\b]</code></strong> = <strong><code>\x08</code></strong>.</p>
<p dir="auto">Note that <strong><code>\b</code></strong> must be in a <strong>character class</strong> as <strong><code>\b</code></strong>, <strong>outside</strong> a character class is an <strong>assertion</strong> defining the <strong>empty</strong> location between, <strong>either</strong> :</p>
<ul>
<li>
<p dir="auto">A <strong>Word</strong> character and a <strong>Non word</strong> char</p>
</li>
<li>
<p dir="auto">A <strong>Non word</strong> character and a <strong>Word</strong> char</p>
</li>
</ul>
<p dir="auto">Best regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60429</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60429</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 02 Dec 2020 20:54:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Wed, 02 Dec 2020 18:27:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gioacchino-piazzolla" aria-label="Profile: Gioacchino-Piazzolla">@<bdi>Gioacchino-Piazzolla</bdi></a> said in <a href="/post/60425">How to unescape?</a>:</p>
<blockquote>
<p dir="auto">hi i use this website to do it: <a href="https://www.freeformatter.com/json-escape.html" rel="nofollow ugc">https://www.freeformatter.com/json-escape.html</a></p>
</blockquote>
<p dir="auto">So from what I see of that web site, recording the following <em>Replace All</em> macro will do the same conversion when later run on some selected text:</p>
<p dir="auto"><img src="/assets/uploads/files/1606933299211-e17a6bd8-6f0f-45cc-9096-5c7250136d1f-image.png" alt="e17a6bd8-6f0f-45cc-9096-5c7250136d1f-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Start macro recording after setting up the <em>Replace</em> dialog as shown, press the button indicated with the red dot, then stop macro recording and save the macro with a descriptive name.</p>
<p dir="auto">Here are the find/repl fields as text:</p>
<p dir="auto">find: <code>(?-i)(\x08)|(\x0c)|(\n)|(\r)|(\t)|(")|(\\)</code><br />
repl: <code>(?1\\b)(?2\\f)(?3\\n)(?4\\r)(?5\\t)(?6\\")(?7\\\\)</code></p>
<p dir="auto">Note that <code>\x08</code> could be replaced with <code>\a</code> and <code>\x0c</code> could be replaced with <code>\f</code>.  As you like…</p>
<p dir="auto"><em><strong>Edit:</strong></em> I just noticed that the subject of this thread was “unescaping” and my replace macro does “escaping”.  Oh, well, the unescaping version is left as an exercise for the reader, using what I provided as the model. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60427</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60427</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 02 Dec 2020 18:27:55 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Wed, 02 Dec 2020 16:32:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gioacchino-piazzolla" aria-label="Profile: Gioacchino-Piazzolla">@<bdi>Gioacchino-Piazzolla</bdi></a> said in <a href="/post/60425">How to unescape?</a>:</p>
<blockquote>
<p dir="auto">here to ask if there is a plugin that does the same thing</p>
</blockquote>
<p dir="auto">Probably nobody is going to the trouble to create a plugin to do something that a replace-operation recorded into a macro can easily do.</p>
<p dir="auto">Of course, maybe that functionality is part of a plugin that does more than that (justifying the plugin’s existence); I don’t know.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60426</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60426</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 02 Dec 2020 16:32:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Wed, 02 Dec 2020 16:29:42 GMT]]></title><description><![CDATA[<p dir="auto">hi i use this website to do it: <a href="https://www.freeformatter.com/json-escape.html" rel="nofollow ugc">https://www.freeformatter.com/json-escape.html</a></p>
<p dir="auto">You can escape/unscape a string with this.</p>
<p dir="auto">I’m here to ask if there is a plugin that does the same thing</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60425</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60425</guid><dc:creator><![CDATA[Gioacchino Piazzolla]]></dc:creator><pubDate>Wed, 02 Dec 2020 16:29:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Fri, 28 Oct 2016 10:40:15 GMT]]></title><description><![CDATA[<p dir="auto">a little correction to previous post: there must be \\t instead of \t in the first field</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18865</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18865</guid><dc:creator><![CDATA[Valerjans Vinogradovs]]></dc:creator><pubDate>Fri, 28 Oct 2016 10:40:15 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Fri, 28 Oct 2016 09:58:50 GMT]]></title><description><![CDATA[<p dir="auto">"\r\n\t …</p>
<p dir="auto">as well as</p>
<p dir="auto">\" … \r\n … \t …</p>
<p dir="auto">can be unescaped by find/replace by one click on the button “Replace All” when:</p>
<p dir="auto">in the first field (Find what) is entered: (\\r\\n)|(\t)|(\\\")</p>
<p dir="auto">and in second field (Replace with) is entered: (?1(\r\n))(?2(\t))(?3(\"))</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18864</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18864</guid><dc:creator><![CDATA[Valerjans Vinogradovs]]></dc:creator><pubDate>Fri, 28 Oct 2016 09:58:50 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Sat, 08 Oct 2016 01:53:52 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Is the OP asking how to replace two character sequences (for example, “” followed by “r”) in his editor window with their corresponding single character value (13 or hex 0D in the example)? Just a guess as I can’t really tell.</p>
</blockquote>
<p dir="auto">Didn’t thought about this - thought OP maybe has some code with literals \t …<br />
and the compiler complaint about it but …</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18308</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18308</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Sat, 08 Oct 2016 01:53:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Sat, 08 Oct 2016 00:19:38 GMT]]></title><description><![CDATA[<p dir="auto">Is the OP asking how to replace two character sequences (for example, "" followed by “r”) in his editor window with their corresponding single character value (13 or hex 0D in the example)?  Just a guess as I can’t really tell.</p>
<p dir="auto">This speaks to a general complaint about a lot of posters on this community:  Not enough information is given to BEST solve a problem.  People will post, “How can I do XXX?” when a much better question is “I think I need to do XXX because I need to achieve &lt;insert detailed explanation here&gt; – how can I best do this?”.  The experts here, who could certainly answer the XXX question, might answer it in a totally different way with the benefit of background info that gives the poster a much better push towards solving their real problem in a efficient, clean and often elegant way!   :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18306</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18306</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 08 Oct 2016 00:19:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Fri, 07 Oct 2016 21:42:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/valerjans-vinogradovs" aria-label="Profile: Valerjans-Vinogradovs">@<bdi>Valerjans-Vinogradovs</bdi></a></p>
<p dir="auto">first post ("\r\n\t…)<br />
next post (for example: " … \r\n … \t …)</p>
<p dir="auto">I assume the real text is even different, so how should we know what your text really looks like to give you an advice?? Because of that lack of information I only can give<br />
you an general answer.</p>
<p dir="auto">If there is a pattern you might be able to use Extended search mode, if the pattern<br />
is different try to find a regular expression which fits all.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18300</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18300</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 07 Oct 2016 21:42:17 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Fri, 07 Oct 2016 06:46:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-frank" aria-label="Profile: Claudia-Frank">@<bdi>Claudia-Frank</bdi></a>, How  <strong>in find/replace</strong> to unescape all escapes (for example: \" … \r\n … \t …) in the whole <strong>text</strong> by one command (by one click on the button “Replace All”)?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18268</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18268</guid><dc:creator><![CDATA[Valerjans Vinogradovs]]></dc:creator><pubDate>Fri, 07 Oct 2016 06:46:43 GMT</pubDate></item><item><title><![CDATA[Reply to How to unescape? on Fri, 07 Oct 2016 00:26:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/valerjans-vinogradovs" aria-label="Profile: Valerjans-Vinogradovs">@<bdi>Valerjans-Vinogradovs</bdi></a></p>
<p dir="auto">if it is text -&gt; find/replace, if it isn’t text than be more specific about what you want.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/18263</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/18263</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 07 Oct 2016 00:26:18 GMT</pubDate></item></channel></rss>