<?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 different values from the xml tags with one value in all the open documents.]]></title><description><![CDATA[<p dir="auto">Replace different values from the xml tags with one value in all the open documents.</p>
<p dir="auto">I have around 30-40 xml files for each soap testcase and the xml files have the below tag with this random data.</p>
<p dir="auto">&lt;regUID&gt;76D89A01-1326-4A0A-9D2B-69C9A3D570AE&lt;/regUID&gt; (file 1)<br />
&lt;regUID&gt;96E197E2-05CE-47CC-AA41-1FBB0A019A5E&lt;/regUID&gt; (file 2)</p>
<p dir="auto">I need to make the above tag as<br />
&lt;regUID&gt;${=java.util.UID.randomUID()}&lt;/regUID&gt;</p>
<p dir="auto">So that the value inside the regUID tag is set as dynamic and it should be replaced to the above value in all the open xml documents.</p>
<p dir="auto">I cannot perform the random operation of find and replace in all open documents because there is no constant value that can be found.</p>
<p dir="auto">Guys, if you can help, it will be really appreciated.</p>
<p dir="auto">Thanks in advance.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19975/replace-different-values-from-the-xml-tags-with-one-value-in-all-the-open-documents</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 11:59:16 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19975.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 09 Sep 2020 12:29:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Thu, 10 Sep 2020 10:28:18 GMT]]></title><description><![CDATA[<p dir="auto">Replace With = <code>&gt;${=java.util.UID.randomUID\(\)}&lt;</code></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a><br />
It’s tough to make that assumption, when so little data is provided.</p>
<p dir="auto">You’re right.<br />
What is an example, such an answer</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57500</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57500</guid><dc:creator><![CDATA[Olivier Thomas]]></dc:creator><pubDate>Thu, 10 Sep 2020 10:28:18 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Thu, 10 Sep 2020 04:51:18 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19463">@Olivier-Thomas</a></p>
<p dir="auto">First of all, this is my first ever post on community platform asking solution to a doubt. Never expected any reply to this post.<br />
But I received suggestions and i’m grateful for that.</p>
<p dir="auto">Yes, I provided little information on the query. Apologies for that.<br />
The xml files I’m talking about is SOAP request XML’s with about 100-150 lines of data.</p>
<p dir="auto">I tried out both the suggestions by <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> and <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19463">@Olivier-Thomas</a> and it worked.</p>
<ol>
<li></li>
</ol>
<p dir="auto">Find What = (?-s)&lt;regUID&gt;(.*?)&lt;/regUID&gt;<br />
Replace With = &lt;regUID&gt;${=java.util.UID.randomUID()}&lt;/regUID&gt;</p>
<ol start="2">
<li></li>
</ol>
<p dir="auto">Find What = &lt;regUID&gt;.+&lt;/regUID&gt;<br />
Replace With = &lt;regUID&gt;${=java.util.UID.randomUID()}&lt;/regUID&gt;</p>
<p dir="auto">Thank you all of you for providing help!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57498</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57498</guid><dc:creator><![CDATA[Savio shaji]]></dc:creator><pubDate>Thu, 10 Sep 2020 04:51:18 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Wed, 09 Sep 2020 19:41:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19463">@Olivier-Thomas</a> said in <a href="/post/57487">Replace different values from the xml tags with one value in all the open documents.</a>:</p>
<blockquote>
<p dir="auto">And I assumed his data only has &lt;regUID&gt; tags as seen in the example.</p>
</blockquote>
<p dir="auto">It’s tough to make that assumption, when so little data is provided.</p>
<p dir="auto">What people do here, when little data is provided, is to “assume the typical” (or ask for more info).</p>
<p dir="auto">“Typical” for a “file with tags” is that there are many, different types of these.</p>
<p dir="auto">What this can do is avoid the frequently observed <em>next</em> exchange:  “But my data has many types of tags, and your solution doesn’t handle that…”</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57490</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57490</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 09 Sep 2020 19:41:56 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Wed, 09 Sep 2020 19:20:54 GMT]]></title><description><![CDATA[<p dir="auto">And I assumed his data only has &lt;regUID&gt; tags as seen in the example.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57487</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57487</guid><dc:creator><![CDATA[Olivier Thomas]]></dc:creator><pubDate>Wed, 09 Sep 2020 19:20:54 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Wed, 09 Sep 2020 18:52:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a></p>
<p dir="auto">Agreed.<br />
Often people try to be “impressive” by coming up with a shorter regex.<br />
This is best-left to the “pros”, if it even needs to be done at all.<br />
I’m a believer in NOT doing this kind of thing.<br />
If a solution works, it doesn’t have to be short or even efficient.<br />
To bear repeating: This isn’t a regex site (where such things might excite the participants).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57484</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57484</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 09 Sep 2020 18:52:14 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Wed, 09 Sep 2020 18:45:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19463">@Olivier-Thomas</a> said in <a href="/post/57481">Replace different values from the xml tags with one value in all the open documents.</a>:</p>
<blockquote>
<p dir="auto">or … like this<br />
<strong>Find What</strong> = <code>&gt;.+&lt;</code><br />
<strong>Replace With</strong> = <code>&gt;${=java.util.UID.randomUID\(\)}&lt;</code></p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19744">@savio-shaji</a> ,</p>
<p dir="auto">Be wary when following that advice.  It will work – if the only sequence of <code>&gt;</code> followed by any text followed by <code>&lt;</code> just happens to be your <code>&lt;regUID&gt;</code> pair.  If you have <em>any</em> tags you don’t want to replace (if there is any other <code>&lt;tag&gt;...&lt;/tag&gt;</code> sequence in your data than the <code>&lt;regUID&gt;...&lt;/regUID&gt;</code> sequence), it would be a bad idea to try <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19463">@Olivier-Thomas</a>’s regex, because it would change the contents of every single tag in your XML file.  Please be wary.  I made my regex more specific, only changing things inside <code>&lt;regUID&gt;</code> pairs,  because I didn’t want to assume that your data only had <code>&lt;regUID&gt;</code> tags and no other tags.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57483</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57483</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 09 Sep 2020 18:45:47 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Wed, 09 Sep 2020 18:32:00 GMT]]></title><description><![CDATA[<p dir="auto">or … like this<br />
<strong>Find What</strong> = <code>&gt;.+&lt;</code><br />
<strong>Replace With</strong> = <code>&gt;${=java.util.UID.randomUID\(\)}&lt;</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/57481</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57481</guid><dc:creator><![CDATA[Olivier Thomas]]></dc:creator><pubDate>Wed, 09 Sep 2020 18:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Wed, 09 Sep 2020 13:37:49 GMT]]></title><description><![CDATA[<p dir="auto">And of course, to augment <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> 's reply, because</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19744">@savio-shaji</a> said:</p>
<blockquote>
<p dir="auto">…should be replaced … in all the open xml documents.</p>
</blockquote>
<p dir="auto">You’ll probably want the <em><strong>Replace All in All Opened Documents</strong></em> button.</p>
<p dir="auto">But you can’t limit that to only xml docs, so probably want to close others first if the potential for hits in non-xml files exists.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57475</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57475</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 09 Sep 2020 13:37:49 GMT</pubDate></item><item><title><![CDATA[Reply to Replace different values from the xml tags with one value in all the open documents. on Wed, 09 Sep 2020 13:11:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19744">@savio-shaji</a> said in <a href="/post/57473">Replace different values from the xml tags with one value in all the open documents.</a>:</p>
<blockquote>
<p dir="auto">&lt;regUID&gt;${=java.util.UID.randomUID()}&lt;/regUID&gt;</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/19744">@savio-shaji</a>,</p>
<p dir="auto">I will assume you want that literal text as the replacement to go in the XML file, and that your Java will take care of the “dynamic” at a later time.</p>
<p dir="auto">If that’s the case, then it’s going to be really easy, using Notepad++'s “Regular Expression” search mode (also known as “regex”).</p>
<p dir="auto">The most straightforward approach is to just look for any text between the opening and closing <code>regUID</code> tags:</p>
<ul>
<li>Find What = <code>(?-s)&lt;regUID&gt;(.*?)&lt;/regUID&gt;</code></li>
<li>Replace With = <code>&lt;regUID&gt;${=java.util.UID.randomUID\(\)}&lt;/regUID&gt;</code></li>
<li>Search Mode = Regular Expression</li>
<li><strong>Replace All</strong></li>
</ul>
<p dir="auto">However, that has the problem that if you have</p>
<pre><code>&lt;regUID&gt;Invalid, so don't put replacement here&lt;/regUID&gt;
</code></pre>
<p dir="auto">it would match, which you might not want.</p>
<p dir="auto">If you want to ensure that there’s only UUID data between the tags, you can use <a href="https://npp-user-manual.org/docs/searching/#character-classes" rel="nofollow ugc">character classes</a> to limit what’s allowed between the tags.</p>
<ul>
<li>Find What = <code>(?-s)&lt;regUID&gt;(&lsqb;&lsqb;:xdigit:&rsqb;&rsqb;{8}-&lsqb;&lsqb;:xdigit:&rsqb;&rsqb;{4}-&lsqb;&lsqb;:xdigit:&rsqb;&rsqb;{4}-&lsqb;&lsqb;:xdigit:&rsqb;&rsqb;{4}-&lsqb;&lsqb;:xdigit:&rsqb;&rsqb;{12})&lt;/regUID&gt;</code></li>
<li>Replace With = <code>&lt;regUID&gt;${=java.util.UID.randomUID\(\)}&lt;/regUID&gt;</code></li>
<li>Search Mode = Regular Expression</li>
<li><strong>Replace All</strong></li>
</ul>
<p dir="auto"><strong>&lt;edit&gt;</strong> PS: had to add <code>\</code> before the <code>(</code> and <code>)</code> in the replacement, because parens are still special in replacement syntax. <strong>&lt;/edit&gt;</strong></p>
<p dir="auto">----</p>
<p dir="auto"><em>Do you want regex search/replace help?  Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you.  All example text should be marked as plain text using the <code>&lt;/&gt;</code> toolbar button or manual <a href="https://community.notepad-plus-plus.org/topic/14262/how-to-markdown-code-on-this-forum/4">Markdown syntax</a>. Screenshots can be pasted from the clipboard to your post using <code>Ctrl+V</code> to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have <strong>and</strong> the text you want to get from that data; include examples of things that <strong>should match</strong> and be transformed, <strong>and</strong> things that <strong>don’t match</strong> and should be left alone; show <strong>edge cases</strong> and make sure you examples are as <strong>varied</strong> as your real data.  Show the regex you already tried, <strong>and why</strong> you thought it should work; tell us what’s wrong with what you <strong>do</strong> get… Read the official <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">NPP Searching / Regex docs</a> and the forum’s <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/57474</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57474</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 09 Sep 2020 13:11:30 GMT</pubDate></item></channel></rss>