<?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[Regex searching for NUL characters]]></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> or anyone else with input:</p>
<p dir="auto">In the <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">FAQ</a> it is implied that current Notepad++ has a problem doing regular expression searching for embedded NUL characters via this statement, which might at first read be confusing because it is talking about the benefits of using a non-standard N++ version:</p>
<p dir="auto"><em><strong>“Both, search and replace strings can contain embedded NUL characters and/or Escape sequences for NUL characters ( \x{0000} )”</strong></em></p>
<p dir="auto">But…I did NOT find searching for embedded NULs to be a problem with Notepad++ 7.8.6; am I missing something?</p>
<p dir="auto"><img src="/assets/uploads/files/1589627700097-ec548427-c30a-430e-a746-e18785acd0d9-image.png" alt="ec548427-c30a-430e-a746-e18785acd0d9-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19410/regex-searching-for-nul-characters</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 19:32:44 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19410.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 May 2020 11:19:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regex searching for NUL characters on Sun, 17 May 2020 17:03:59 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <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">Here is a solution, as a <strong>work-around</strong>, to manage the presence of the <strong><code>NUL</code></strong> character(s) in a file :</p>
<ul>
<li>
<p dir="auto">Choose an <strong>other</strong> character, <strong>not</strong> used, yet, in your file. Let’s take the <strong><code>\x{007F}</code></strong> control character <strong>Delete</strong></p>
</li>
<li>
<p dir="auto">So, you first run the <strong>regex</strong> S/R, below, with the <strong><code>Wrap around</code></strong> option and the <strong><code>Regular expression</code></strong> search mode</p>
<ul>
<li>
<p dir="auto">SEARCH  <strong><code>\0</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\x7F</code></strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">Then you perform all your text <strong>manipulations</strong>, in <strong>Notepad++</strong></p>
</li>
<li>
<p dir="auto">Finally, <strong>save</strong> your file and exit N++</p>
</li>
<li>
<p dir="auto">As we <strong>cannot</strong> insert any <strong><code>NUL</code></strong> character, with an N++ <strong>replacement</strong>, we’ll simply use the <strong>well known</strong> utility <strong><code>sed.exe</code></strong></p>
<ul>
<li>
<p dir="auto">You can download its <strong>last</strong> Windows <strong><code>v4.8 - 64 bits</code></strong> version, from   <a href="https://github.com/mbuilov/sed-windows" rel="nofollow ugc">https://github.com/mbuilov/sed-windows</a></p>
</li>
<li>
<p dir="auto">Or <strong>other</strong> versions, from    <a href="https://github.com/mbuilov/sed-windows/tree/master/archive" rel="nofollow ugc">https://github.com/mbuilov/sed-windows/tree/master/archive</a></p>
</li>
</ul>
</li>
<li>
<p dir="auto">Then, in a <strong><code>DOS</code></strong> console window, type in and execute this simple <strong>command</strong> :</p>
<ul>
<li><strong><code>sed.exe -i s/\x7f/\x00/ </code>Your_File</strong></li>
</ul>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53959</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53959</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 17 May 2020 17:03:59 GMT</pubDate></item><item><title><![CDATA[Reply to Regex searching for NUL characters on Sat, 16 May 2020 19:35:50 GMT]]></title><description><![CDATA[<p dir="auto">So after a bit more real work with NULs…</p>
<p dir="auto">I noticed that the <em>Find result</em> window, after a <em>Find All in Current Document</em>, on a line with NULs, shows only the part of the line <em>BEFORE</em> the first NUL.</p>
<p dir="auto">A bit of time later, I noticed <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/6281" rel="nofollow ugc">THIS</a>.  :-(</p>
<p dir="auto">I do agree that NUL isn’t a typical use case for a text file, but…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53923</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53923</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 16 May 2020 19:35:50 GMT</pubDate></item><item><title><![CDATA[Reply to Regex searching for NUL characters on Sat, 16 May 2020 12:26:46 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/53915">Regex searching for NUL characters</a>:</p>
<blockquote>
<p dir="auto">our present Boost regex engine do handle the NUL characters, but ONLY  in the search regex !</p>
</blockquote>
<p dir="auto">Ah, okay; thanks for the confirmation on what I was seeing in practice!<br />
Is it clear that the FAQ entry is implying that the even a search does not currently work when that is truly not the case?</p>
<blockquote>
<p dir="auto">Beware also that, in Extended search mode, you cannot search any string with contains characters after a first \0 character. For instance, search of \0 or abc\0 do work properly but the search of \0abc or even \0\0 fails !</p>
</blockquote>
<p dir="auto">Indeed, it appears to be a known issue to others besides yourself; see <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/8270" rel="nofollow ugc">HERE</a>.</p>
<p dir="auto">Perhaps to someone with a C/C++ background, this behavior, although not good, is totally understandable!? :-)</p>
<p dir="auto">I’m just thankful I don’t try to edit files with NULs very often.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53916</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53916</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 16 May 2020 12:26:46 GMT</pubDate></item><item><title><![CDATA[Reply to Regex searching for NUL characters on Sat, 16 May 2020 12:16:58 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a> and <strong><code>All</code></strong>,</p>
<p dir="auto">When I wrote, in that <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">FAQ</a> that :</p>
<ul>
<li>Both, <strong>search</strong> and <strong>replace</strong> strings can contain <strong>embedded NUL</strong> characters and/or <strong>Escape</strong> sequences for <strong>NUL</strong> characters ( <strong><code>\x{0000}</code></strong> )</li>
</ul>
<p dir="auto">I was referring, <strong>specifically</strong>, to the <strong><code>Francois-R Boyer</code></strong> regex engine <strong>version</strong> !</p>
<p dir="auto">But, indeed, our present <strong><code>Boost</code></strong> regex engine <strong>do</strong> handle the <strong><code>NUL</code></strong> characters, but <em>ONLY</em>  in the <strong>search</strong> regex ! <strong>Embedded</strong> <strong><code>NUL</code></strong> chars in replacement, <strong>breaks</strong> the replacement process :-((</p>
<hr />
<p dir="auto">BTW, for the record, in the <strong><code>Find what:</code></strong> zone, <strong>any</strong> of the <strong>regex</strong> syntaxes, below, can be used to match a <strong>single</strong> <em>Control</em> character <strong>NUL</strong>, of Unicode point-point <strong><code>0000</code></strong> :</p>
<ul>
<li>
<p dir="auto">In <strong><code>Regular expression</code></strong> search mode :</p>
<ul>
<li>
<p dir="auto"><strong><code>\0</code></strong>  ,  <strong><code>\00</code></strong>  ,  <strong><code>\000</code></strong>  ,  <strong><code>\0000 </code></strong>    in <strong>octal</strong></p>
</li>
<li>
<p dir="auto"><strong><code>\x0</code></strong>  ,  <strong><code>\x00</code></strong>  ,  <strong><code>\x{00}</code></strong>  ,  <strong><code>\x{000}</code></strong>  ,  <strong><code>\x{0000}</code></strong>    in <strong>hexadecimal</strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">In <strong><code>Extended</code></strong> search mode :</p>
<ul>
<li>
<p dir="auto"><strong><code>\0</code></strong> ( <strong>special</strong> syntax )</p>
</li>
<li>
<p dir="auto"><strong><code>\d000</code></strong>  ,  <strong><code>\o000</code></strong>  ,  <strong><code>\b00000000</code></strong>  ,  <strong><code>\x00</code></strong>    in <strong>decimal</strong>, <strong>octal</strong>, <strong>binary</strong> and <strong>hexadecimal</strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">Beware also that, in <strong><code>Extended</code></strong> search mode, you <strong>cannot</strong> search any string with contains characters <strong>after</strong> a first <strong><code>\0</code></strong> character. For instance, search of <strong><code>\0</code></strong> or <strong><code>abc\0</code></strong> do work <strong>properly</strong> but the search of <strong><code>\0abc</code></strong> or even <strong><code>\0\0</code></strong> <strong>fails</strong>  !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/53915</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/53915</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 16 May 2020 12:16:58 GMT</pubDate></item></channel></rss>