<?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 command to delete string with variable numbers]]></title><description><![CDATA[<p dir="auto">Hello everyone,</p>
<p dir="auto">i am looking for the proper RegEx command in order to delete a recurrent string with variable numbers.</p>
<p dir="auto">I want to delete the timestamps on a Summary Comment page from a PDF. For now i can do it manually one by one: exporting the FDF data, rename as XML, open it with Notepad++ and search for those strings:</p>
<pre><code>code_text
/CreationDate(D:20200605015359+02'00') 
/M(D:20200605015359+02'00')
code_text
</code></pre>
<p dir="auto">numbers are the timestamp variable.</p>
<p dir="auto">and finally rename it as FDF.</p>
<p dir="auto">In fact since dont know how to code stuff, if someone is kinda enough im looking for a script that do the same thing without open notepad++.</p>
<p dir="auto">Thanks in advance</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19518/regex-command-to-delete-string-with-variable-numbers</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 13:01:17 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19518.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Jun 2020 16:08:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Sun, 21 Jun 2020 10:16:09 GMT]]></title><description><![CDATA[<p dir="auto">Hello, first of all thanks everyone for the help.</p>
<p dir="auto">I have tried the first proposal (?:/CreationDate|/M)(D:\d{14}+02’00’) from <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-kilborn">@<bdi>Alan-kilborn</bdi></a> and it works perfectly since i dont need the \x20 space char.</p>
<p dir="auto">For some reason if i use the other proposals, Acrobat refuse to import the modified fdf file because an unspecified error.</p>
<p dir="auto">Anyway, i resolved my problem now. I use this script to remove the autor name <a href="https://adobe.ly/3emVRkC" rel="nofollow ugc">https://adobe.ly/3emVRkC</a> and the search RegEx for the timestamp.</p>
<p dir="auto">Thanks again.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55227</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55227</guid><dc:creator><![CDATA[Paul smithers]]></dc:creator><pubDate>Sun, 21 Jun 2020 10:16:09 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Sun, 07 Jun 2020 11:01:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-smithers" aria-label="Profile: paul-smithers">@<bdi>paul-smithers</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 guess I must have been <strong>influenced</strong> by my <strong>upcoming</strong> documentation on <strong><code>Backtracking control verbs</code></strong> !</p>
<p dir="auto">In fact, be <strong>reassured</strong>, there is still a <strong>classical</strong> solution, which does <strong>not</strong> use this <strong>new</strong> feature. Here it is this <strong>second</strong> solution, written with the <strong>free-spacing</strong> mode <strong><code>(?x)</code></strong> :</p>
<p dir="auto">SEARCH <strong><code>(?x-s)  (^.+\])  |  (?=.+/F)  (.)  |  (/F\x2028/)  |  (?=.+NM)  (.)</code></strong></p>
<p dir="auto">REPLACE <strong><code>(?1$0)(?2\x20)(?3$0)(?4\x20)</code></strong></p>
<p dir="auto">As you can see :</p>
<ul>
<li>
<p dir="auto">Any part, that we do <strong>not</strong> want to match, is simply <strong>rewritten</strong> ( <strong><code>$0</code></strong> )</p>
</li>
<li>
<p dir="auto">In zones, that we <strong>do</strong> care of, each <strong>single standard</strong> character ( <strong><code>.</code></strong> ) is replaced with a <strong>space</strong> char ( <strong><code>\x20</code></strong> )</p>
</li>
</ul>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54762</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54762</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 07 Jun 2020 11:01:46 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Sat, 06 Jun 2020 22:10:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-smithers" aria-label="Profile: paul-smithers">@<bdi>paul-smithers</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"><strong>Yeaaaah</strong> ! Indeed, there is a method ;-))</p>
<p dir="auto">I thought about the very <strong>basic</strong> replacement of <strong>each single</strong> standard char( <strong><code>.</code></strong> ) with a <strong>space</strong> char ( <strong><code>\x20</code></strong> )</p>
<p dir="auto">But we need to <strong>replace</strong> text with <strong>spaces</strong>, in some zones <strong>only</strong>, <strong>not</strong> everywhere ! To achieve such a task, we’ll use a <strong>new</strong> feature of our <strong>regex engine</strong>, since Notepad++ <strong><code>v7.7</code></strong> : the <strong><code>backtracking control verbs</code></strong> ! <strong>Why</strong> this idea came to my mind ? Well, just because I’m preparing a <strong>documentation</strong> on these <strong>zero-width assertions</strong> !</p>
<p dir="auto">Fundamentally, the goal is to use this <strong>generic</strong> regex, below :</p>
<p dir="auto"><strong><code>^What we do NOT want to match(*SKIP)((*F)|what we WANT to match, delimited with a LOOK-AHEAD|Again, what we do NOT want to match(*SKIP)(*F)|Again,what we WANT to match, delimited by an other LOOK-AHEAD|....</code></strong>  and <strong>so on</strong></p>
<p dir="auto"><strong>Alan</strong>, could you be <strong>patient</strong> till I build up and post this <strong>documentation</strong> about these <strong><code>backtracking control verbs</code></strong> ?</p>
<p dir="auto">Meanwhile, you’ll find some <strong>hints</strong>, here :</p>
<p dir="auto"><a href="https://www.rexegg.com/backtracking-control-verbs.html#skipfail" rel="nofollow ugc">https://www.rexegg.com/backtracking-control-verbs.html#skipfail</a></p>
<hr />
<p dir="auto">A little <strong>practice</strong> :</p>
<p dir="auto">Assuming the <strong>initial</strong> and <strong>final</strong> text, desired by <a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-smithers" aria-label="Profile: paul-smithers">@<bdi>paul-smithers</bdi></a></p>
<pre><code class="language-diff">BEFORE : &lt;&lt;/C[1.0 0.819611 0.0]/CreationDate(D:20200606114426+02'00')/F 28/M(D:20200606114426+02'00')/NM...
AFTER  : &lt;&lt;/C[1.0 0.819611 0.0]                                      /F 28/                           NM...
</code></pre>
<p dir="auto">We can tell that :</p>
<ul>
<li>
<p dir="auto">First, text, from <strong><code>beginning</code></strong> of line till a <strong><code>]</code></strong> is <strong>unwanted</strong></p>
</li>
<li>
<p dir="auto">Then, text, till the string <strong><code>/F</code></strong>, is <strong>wanted</strong> and, for <strong>each single</strong> char in this zone, we want to <strong>replace</strong> it with a <strong>space</strong> char</p>
</li>
<li>
<p dir="auto">Now, the text <strong><code>/F 28/</code></strong> is <strong>unwanted</strong></p>
</li>
<li>
<p dir="auto">Finally, text till the string <strong><code>NM</code></strong> is also <strong>wanted</strong> and again, for <strong>each single</strong> char in this zone, we want to <strong>replace</strong> it with a <strong>space</strong> char</p>
</li>
</ul>
<hr />
<p dir="auto">So, look how <strong>easy</strong> it is to build up the <strong>search</strong> regex, from the points <strong>above</strong> ! In addition, I’ll use the <strong><code>free spacing</code></strong> mode for a better <strong>readability</strong></p>
<p dir="auto">SEARCH  <strong><code>(?x-s)   ^.+\]   (*SKIP)(*F)   |   (?=.+/F)  .   |  /F\x2028/  (*SKIP)(*F)  |  (?=.+NM)  .</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
<p dir="auto">We get :</p>
<pre><code class="language-diff">
Text of @paul-smithers :

BEFORE : &lt;&lt;/C[1.0 0.819611 0.0]/CreationDate(D:20200606114426+02'00')/F 28/M(D:20200606114426+02'00')/NM...
AFTER  : &lt;&lt;/C[1.0 0.819611 0.0]                                      /F 28/                           NM...

Other TESTS :

BEFORE : [1.0 0.819611 0.0]/CreationDate(D:20200606114426)/F 28/M(D:20200606+02'00')/NM...
AFTER  : [1.0 0.819611 0.0]                               /F 28/                     NM...


BEFORE : [1.0 0.819611]/CreationDate(+02'00')/F 28/M(D:114426+02)/NM...
AFTER  : [1.0 0.819611]                      /F 28/               NM...

</code></pre>
<p dir="auto"><strong>Magic</strong>, isn’t it ;-))</p>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">Beware of the final <strong>dot</strong>, after the two <strong>positive look-aheads</strong> !</p>
</li>
<li>
<p dir="auto">Of course, in case of an <strong>huge</strong> file, problem of <strong>performance</strong> may occurs, as <strong>each single</strong> character is replaced with a <strong>space</strong> !</p>
</li>
<li>
<p dir="auto">Note, also, that the use of the <strong><code>\K</code></strong> feature would <strong>not</strong> give the <strong>same</strong> behavior. Indeed, in that case, the part <strong>after</strong> <strong><code>\K</code></strong> ( the <strong><code>.</code></strong> ) must come, necessarily, <strong>right after</strong> <strong><code>\K</code></strong>, because this regex contains <strong><code>2</code></strong> <strong>alternatives</strong> only, unlike the <strong><code>4</code></strong> <strong>alternatives</strong> of the <strong>former</strong> regex ! Just try it :</p>
</li>
</ul>
<p dir="auto">SEARCH <strong><code>(?-s)^.+\]\K(?=.+/F).|/F 28/\K(?=.+NM).</code></strong></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54755</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54755</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 06 Jun 2020 22:10:15 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Sat, 06 Jun 2020 14:07:36 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></p>
<p dir="auto">Hi Guy,<br />
Is there a way to get the number of spaces to use for the replacement, from the length of the original match?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54732</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54732</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 06 Jun 2020 14:07:36 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Sat, 06 Jun 2020 13:08:29 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-smithers" aria-label="Profile: paul-smithers">@<bdi>paul-smithers</bdi></a> and All,</p>
<p dir="auto">A <strong><code>regex</code></strong> <strong>search/replacement</strong> could be :</p>
<p dir="auto">SEARCH <strong><code>(?-i)(?:(/CreationDate)|M)\(D:\d{14}\+02'00'\)/</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(?1\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20/)</code></strong></p>
<p dir="auto">And here are the <strong>changes</strong> :</p>
<pre><code class="language-diff">BEFORE : &lt;&lt;/C[1.0 0.819611 0.0]/CreationDate(D:20200606114426+02'00')/F 28/M(D:20200606114426+02'00')/NM...
AFTER  : &lt;&lt;/C[1.0 0.819611 0.0]                                      /F 28/                           NM...
</code></pre>
<p dir="auto">As <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> said, if the string <strong><code>+02'00'</code></strong> is <strong>not</strong> constant, change the <strong>search</strong> regex as below :</p>
<p dir="auto">SEARCH <strong><code>(?-i)(?:(/CreationDate)|M)\(D:\d{14}.{7}\)/</code></strong></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54727</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54727</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 06 Jun 2020 13:08:29 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Sat, 06 Jun 2020 11:23:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-smithers" aria-label="Profile: Paul-smithers">@<bdi>Paul-smithers</bdi></a></p>
<p dir="auto">I’d say this regex could match your situation:</p>
<p dir="auto"><code>(?:/CreationDate|/M)\(D:\d{14}\+02'00'\)</code></p>
<p dir="auto">It seems like the <code>+02'00'</code> is constant, but if it is variable, we can deal with that as well.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54723</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54723</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 06 Jun 2020 11:23:44 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Sat, 06 Jun 2020 10:52:57 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your quick response.</p>
<p dir="auto">Let me clarify what i need.</p>
<p dir="auto">In Adobe DC it is possible to create a file with all comments written on the pdf documents, it’s called Comment summary:<br />
<a href="https://helpx.adobe.com/acrobat/kb/print-comments-acrobat-reader.html" rel="nofollow ugc">https://helpx.adobe.com/acrobat/kb/print-comments-acrobat-reader.html</a></p>
<p dir="auto">What i want is delete the comment timestamps on that file. It is possible exporting the comments metadata as .fdf file.</p>
<p dir="auto">Change extension to .xml and it looks something like this:</p>
<p dir="auto"><img src="/assets/uploads/files/1591440775088-timestamptest3.jpg" alt="timestamptest3.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Now for every comment delete the two strings:</p>
<p dir="auto">/CreationDate(D:20200605015359+02’00’)<br />
/M(D:20200605015359+02’00’)</p>
<p dir="auto">The numbers are the timestamp that change everytime.</p>
<p dir="auto">The result should be like this:</p>
<p dir="auto"><img src="/assets/uploads/files/1591440762237-timestamptest4.jpg" alt="timestamptest4.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">For now i do it manually, and i would ask the proper RegEx search line for searching all those two string and replace them with nothing, ie delete them.</p>
<p dir="auto">Since i have many pdf with hundreds comments, it would be nice if someone helps me writing a script that do the same job without replace them in notepad++.</p>
<p dir="auto">Thanks again</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54722</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54722</guid><dc:creator><![CDATA[Paul smithers]]></dc:creator><pubDate>Sat, 06 Jun 2020 10:52:57 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx command to delete string with variable numbers on Fri, 05 Jun 2020 17:02:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/paul-smithers" aria-label="Profile: Paul-smithers">@<bdi>Paul-smithers</bdi></a></p>
<p dir="auto">You’re probably going to want to show some “after” text sample as well.<br />
The way I read what you want is that you’d end up with:</p>
<pre><code>code_text
code_text
</code></pre>
<p dir="auto">which I’m 99% certain isn’t what you want.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54707</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54707</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 05 Jun 2020 17:02:28 GMT</pubDate></item></channel></rss>