<?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 text that ends with number]]></title><description><![CDATA[<p dir="auto">In a txt file , I want to replace string in BOLD</p>
<p dir="auto">just a random text/live/<strong>y8mJepPsAk/UgZtTKd6A8</strong>/79953<br />
just a random text/live/<strong>SvSvuq6JV5/eE3dg0bAMr</strong>/79954<br />
just a random text/live/<strong>eME6hoeNV9/PJa5HwhUnF</strong>/88974<br />
just a random text/live/<strong>bUue7Vprac/sue0ZmGzwy</strong>/78385<br />
just a random text/live/<strong>UznB0niAEp/MgspVk69tX</strong>/93994</p>
<p dir="auto">I tried this code :</p>
<p dir="auto">Replace : live/.*?/[0-9]<br />
Replace with : live/my-new-text/</p>
<p dir="auto">But the problem is that the first number after “/” is deleted.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16020/replace-text-that-ends-with-number</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 20:59:18 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16020.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Jul 2018 10:53:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replace text that ends with number on Mon, 09 Jul 2018 17:41:42 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/12512">@anass-chawki</a>, and <strong>All</strong></p>
<p dir="auto">Ah, OK ! The <strong>changes</strong> to do are <strong>not</strong> that important ;-))</p>
<p dir="auto">From your <strong>last</strong> example, I, then, supposed that the <strong>match</strong> is the <strong>shortest</strong> range of characters between :</p>
<ul>
<li>
<p dir="auto">The <strong>literal</strong> string <strong>live/</strong></p>
</li>
<li>
<p dir="auto">A string made up of, at least, <strong>five consecutive digits</strong></p>
</li>
</ul>
<p dir="auto">So, my <strong>two previous</strong> search regexes become :</p>
<p dir="auto">SEARCH <strong><code>(?-s)(?&lt;=live/).+?(?=/\d{5,})</code></strong></p>
<p dir="auto">and  :</p>
<p dir="auto">SEARCH <strong><code>(?-s)live/.*/([0-9]\d{5,})</code></strong></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<ul>
<li>
<p dir="auto">I <strong>updated</strong> my <strong>two</strong> previous <strong>replacement</strong> regexes, which were <strong>misspelled</strong> !</p>
</li>
<li>
<p dir="auto">The regexes look for the <strong>shortest non-empty</strong> range of characters ( <strong><code>.+?</code></strong> ), between the <strong>two</strong> limits, to <strong>avoid</strong> a <strong>wrong</strong> match against this kind of data :</p>
</li>
</ul>
<p dir="auto"><a href="http://mywebsite.net:8080/live/JHsN4SGBS7/2MOLFqluEk/102381.ts%7Cuser-agent=VLC/2.2.6%20/123456LibVLC/2.2.6" rel="nofollow ugc">http://mywebsite.net:8080/live/JHsN4SGBS7/2MOLFqluEk/102381.ts|user-agent=VLC/2.2.6 /123456LibVLC/2.2.6</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/33435</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/33435</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 09 Jul 2018 17:41:42 GMT</pubDate></item><item><title><![CDATA[Reply to Replace text that ends with number on Mon, 09 Jul 2018 13:26:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/12512">@Anass-Chawki</a> ,</p>
<p dir="auto">When asking for help with regular expressions, it is quite useful to include <em>detailed</em> specs as to what should <em>and should not</em> match.</p>
<p dir="auto">A couple of probing questions about your actual requirements:</p>
<ol>
<li>All your examples show the two “replaced words” as 10 characters each.
<ul>
<li>Are there always going to be exactly two “replaced words”, or could it sometimes be 1, usually 2, and sometimes 3 or more?</li>
<li>Are there always going to be exactly 10 characters in each of the “replaced words”? or can it vary from <em>x</em> to <em>y</em>?  Or is it always at least 2?  or …</li>
</ul>
</li>
<li>For the numbers at the end, your first example shows only 5 digits, but your updated example has 6 digits
<ul>
<li>Are there always going to at least 5 numbers? Or always exactly 5-6?  Or …?</li>
</ul>
</li>
<li>Are there any other restrictions (this matches, but that doesn’t) or edge cases that you can think of to share?</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/33429</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/33429</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 09 Jul 2018 13:26:44 GMT</pubDate></item><item><title><![CDATA[Reply to Replace text that ends with number on Mon, 09 Jul 2018 12:25:39 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> Thank you for your help . Your answer is correct but I did a mistake by not puting all the line .</p>
<p dir="auto"><a href="http://mywebsite.net:8080/live/JHsN4SGBS7/2MOLFqluEk/102381.ts%7Cuser-agent=VLC/2.2.6" rel="nofollow ugc">http://mywebsite.net:8080/live/JHsN4SGBS7/2MOLFqluEk/102381.ts|user-agent=VLC/2.2.6</a> LibVLC/2.2.6</p>
<p dir="auto">Can you please edit your answer ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/33427</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/33427</guid><dc:creator><![CDATA[Anass Chawki]]></dc:creator><pubDate>Mon, 09 Jul 2018 12:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to Replace text that ends with number on Mon, 09 Jul 2018 17:04:50 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/12512">@anass-chawki</a>, and <strong>All</strong></p>
<p dir="auto">Not very difficult, indeed, with <strong>regular</strong> expressions !</p>
<ul>
<li>Open the Replace dialog ( <strong><code>Ctrl + H</code></strong> )</li>
</ul>
<p dir="auto">SEARCH <strong><code>(?-s)(?&lt;=live/).+(?=/\d+)</code></strong></p>
<p dir="auto">REPLACE <strong><code>my-new-text</code></strong></p>
<ul>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">First, the <strong><code>(?-s)</code></strong> <strong>modifier</strong> forces the regex engine to interpret any <strong><code>.</code></strong> <strong>dot</strong> as matching a <strong>single standard</strong> character only ( <strong>not</strong> an <strong>EOL</strong> character )</p>
</li>
<li>
<p dir="auto">The middle part <strong><code>.+</code></strong> matches any <strong>non-empty</strong> range of <strong>standard</strong> characters but ONLY IF the two <strong>look-around</strong> features, below, ( conditions ) are <strong>true</strong> :</p>
<ul>
<li>
<p dir="auto"><strong><code>(?&lt;=live/)</code></strong> : The range <strong><code>.+</code></strong> must be <strong>preceded</strong> with the string <strong>live/</strong></p>
</li>
<li>
<p dir="auto"><strong><code>(?=/\d+)</code></strong> : The range <strong><code>.+</code></strong> must be <strong>followed</strong> with the string “<strong>/</strong>” and any <strong>non-empty</strong> range of <strong>digits</strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">In <strong>replacement</strong>, this range, between the two <strong><code>/</code></strong> chars, is simply replaced with the <strong><code>my-new-text</code></strong> string</p>
</li>
</ul>
<hr />
<p dir="auto">An other <strong>syntax</strong> could be :</p>
<p dir="auto">SEARCH <strong><code>(?-s)live/.*/([0-9]+)</code></strong></p>
<p dir="auto">REPLACE  <strong><code>live/my-new-text/\1</code></strong></p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">This time the string <strong>live/</strong> is part of the <strong>overall</strong> match, as well as the <strong>slash</strong> and the final <strong>number</strong></p>
</li>
<li>
<p dir="auto">As this number, <strong><code>[0-9]+</code></strong>, is embedded in <strong>parentheses</strong>, it is stored as <strong>group <code>1 </code></strong></p>
</li>
<li>
<p dir="auto">In <strong>replacement</strong>, we rewrite the <strong>live/my-new-text/</strong> string, followed with the <strong>group<code>1</code></strong>, containing the <strong>number</strong></p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/33422</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/33422</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 09 Jul 2018 17:04:50 GMT</pubDate></item></channel></rss>