<?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[Search, Use Result to Add Code]]></title><description><![CDATA[<p dir="auto">I have an xml file that needs to be modified.<br />
I need to search for a callout that has an argument numref, as shown in the code below:</p>
<pre><code>&lt;callout assocfig="fig3" numref="c3"/&gt;
</code></pre>
<p dir="auto">Then, take the number after “c” and insert it before the numref in an argument, label, as below:</p>
<pre><code>&lt;callout assocfig="fig3" label="3" numref="c3"/&gt;
</code></pre>
<p dir="auto">Thanks in advance!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22278/search-use-result-to-add-code</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 03:38:11 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22278.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 17 Dec 2021 17:34:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Search, Use Result to Add Code on Mon, 20 Dec 2021 15:22:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/23397">@richard-howard</a> said in <a href="/post/72245">Search, Use Result to Add Code</a>:</p>
<blockquote>
<p dir="auto">So, after your ‘encouraging me’ to do a little research before just asking for the answer, I found something that works.</p>
</blockquote>
<p dir="auto">Awesome.  You can only get better by taking such initiative.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72249</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72249</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 20 Dec 2021 15:22:34 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Mon, 20 Dec 2021 15:16:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@michael-vincent</a> Excellent!  This forum has saved me uncounted hours.  I appreciate it very much.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72248</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72248</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Mon, 20 Dec 2021 15:16:43 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Mon, 20 Dec 2021 15:16:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/23397">@richard-howard</a> said in <a href="/post/72245">Search, Use Result to Add Code</a>:</p>
<blockquote>
<p dir="auto">… <code>\d[0-9]</code> …</p>
</blockquote>
<p dir="auto">Good job on taking the initiative.</p>
<p dir="auto">Two hints for learning more:</p>
<p dir="auto">You might want to look at what <code>\d</code> means, in the docs regarding <a href="https://npp-user-manual.org/docs/searching/#character-escape-sequences" rel="nofollow ugc">character escape sequences</a>.</p>
<p dir="auto">You might want to look at the docs regarding <a href="https://npp-user-manual.org/docs/searching/#multiplying-operators" rel="nofollow ugc">multiplying operators</a>, looking for something that means “one or more”.</p>
<p dir="auto">Combining those two will simplify your expression, and make it easier to catch c3, c31, and c314 all with the same expression.</p>
<p dir="auto">… ah, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@michael-vincent</a> beat me to the punch… I’d still recommend actually reading the sections of the manual that I linked.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72247</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72247</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 20 Dec 2021 15:16:57 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Mon, 20 Dec 2021 15:14:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/23397">@richard-howard</a> said in <a href="/post/72245">Search, Use Result to Add Code</a>:</p>
<blockquote>
<p dir="auto">So, after your ‘encouraging me’ to do a little research before just asking for the answer, I found something that works.</p>
</blockquote>
<p dir="auto">Excellent!  And in the spirit of collaboration and your research and reporting back, you could try replacing <code>\d</code> in my suggestion with <code>\d+</code> where the <code>+</code> in REGEX syntax means "match at least one of the previous characters - in this case <code>\d</code> which is a digit.  So <code>\d+</code> is “one or more digits” - like “3”, “34”, “1337”, etc…</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72246</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72246</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Mon, 20 Dec 2021 15:14:47 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Mon, 20 Dec 2021 15:08:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/23397">@richard-howard</a> Just an update.  The solution I was offered was very helpful.  It did find and replace as desired, but the find only matched single numeric characters.  Where the “C” was followed by double digits, it did not find it.  So, after your ‘encouraging me’ to do a little research before just asking for the answer, I found something that works.<br />
To find double digits, I replaced:</p>
<pre><code>(numref\s*\=\s*\"c(\d)\")
</code></pre>
<p dir="auto">with:</p>
<pre><code>(numref\s*\=\s*\"c(\d[0-9])\")
</code></pre>
<p dir="auto">Undoubtedly, this is not the only, or best, solution, but it does appear to work, though requires 2 passes to complete all matches.  Just thought you might like to know that your nudge helped.<br />
Thanks.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72245</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72245</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Mon, 20 Dec 2021 15:08:28 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Fri, 17 Dec 2021 17:52:06 GMT]]></title><description><![CDATA[<p dir="auto">Your generosity is appreciated!<br />
Happy Holidays to you all!!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72177</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72177</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Fri, 17 Dec 2021 17:52:06 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Fri, 17 Dec 2021 17:50:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/23397">@richard-howard</a> said in <a href="/post/72173">Search, Use Result to Add Code</a>:</p>
<blockquote>
<p dir="auto">Thanks in advance!</p>
</blockquote>
<p dir="auto">Replace:</p>
<p dir="auto">Find what:  <code>(numref\s*\=\s*\"c(\d)\")</code><br />
Replace with: <code>label="\2" \1</code><br />
Search mode:  Regular expression</p>
<p dir="auto">That’s your one freebie.  Happy weekend, Happy Holidays … as the requirements change based on forthcoming further clarification, you can manipulate / improve the base I provided above to get you started.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72176</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72176</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 17 Dec 2021 17:50:48 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Fri, 17 Dec 2021 17:42:55 GMT]]></title><description><![CDATA[<p dir="auto">Hey, I’m just happy I formatted the question properly, using Code.  :)<br />
I do get your point and if this is inappropriate, ok.<br />
Thanks.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72175</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72175</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Fri, 17 Dec 2021 17:42:55 GMT</pubDate></item><item><title><![CDATA[Reply to Search, Use Result to Add Code on Fri, 17 Dec 2021 17:36:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/23397">@richard-howard</a></p>
<p dir="auto">You have asked many such questions here.<br />
We are not a “substitution” service.<br />
Suggest you take what you’ve learned along the way, couple it with reading the documentation on regular expressions, and at least come up with a stab at it before asking for further help.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72174</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72174</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 17 Dec 2021 17:36:08 GMT</pubDate></item></channel></rss>