<?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[Replace numbers in scattered strings to sequential numbers..]]></title><description><![CDATA[<p dir="auto">OK so the problem is as follows:<br />
There are strings with random values that are scattered throughout the file which i want to change to be sequential.</p>
<p dir="auto">Find What : “This value”:.*,<br />
Will find these lines but i dont know the regex to replace the numbers or how to tell it to stop after say only 20 instances.<br />
. Will find the end of the string and * will allow any value, a wild card (See regex wildcards)</p>
<p dir="auto">IE;<br />
“Some random thing here”:29,<br />
“Another random thing here”:29,<br />
“Something here”:29,<br />
“Random thing here”:29,<br />
<strong>“This value”:39,</strong> &lt;!-- I want to change these to be sequential --&gt;<br />
“Some here”:29,<br />
“Other thing here”:29,<br />
“Thing here”:29,<br />
“Some random thing here”:59,<br />
“Another random thing here”:23,<br />
“Something here”:43,<br />
“Random thing here”:2,<br />
<strong>“This value”:12,</strong> &lt;!-- I want to change these to be sequential --&gt;<br />
“Some here”:18,<br />
“Other thing here”:63,<br />
“Thing here”:63,<br />
…&lt;!-- A few thousand lines of code here–&gt;</p>
<p dir="auto">Thanks in advance to any replies, it isnt anything important but I hope it helps others who might be interested.<br />
I may not reply for some time.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21887/replace-numbers-in-scattered-strings-to-sequential-numbers</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 08:31:21 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21887.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 26 Sep 2021 04:17:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replace numbers in scattered strings to sequential numbers.. on Sun, 26 Sep 2021 18:05:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ryad-arlan" aria-label="Profile: Ryad-Arlan">@<bdi>Ryad-Arlan</bdi></a> ,</p>
<p dir="auto">Search/replace (regex) does not know how to count.  So it cannot increment your replacement, and it cannot count how many replacements it has done.</p>
<p dir="auto">To do that, you need a programming language.  If you use a plugin like PythonScript, you can leverage the full power of the Python language and give it the access to the contents of the Notepad++ editor window.  If you’re willing to go that route, you can search the forum for <a href="https://community.notepad-plus-plus.org/search?term=add_1&amp;in=posts&amp;matchWords=all&amp;sortBy=timestamp&amp;sortDirection=desc&amp;showAs=posts">add_1</a> and find a lot of examples for the “add_1” style of pythonscript search-and-increment-replace.  For stopping after 20 instances, you can look at the optional final argument of the <code>editor.rereplace(search, replace[, flags[, startPosition[, endPosition[, maxCount]]]])</code> method.</p>
<p dir="auto">if you have trouble customizing what you’ve seen elsewhere for your specific situation, show us what you’ve tried, and we might be able to point out where it’s gone wrong.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70041</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70041</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 26 Sep 2021 18:05:31 GMT</pubDate></item></channel></rss>