<?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: How to replace the content of a tag]]></title><description><![CDATA[<p dir="auto">hy. I want to math all the words that end with “!” from this tag:</p>
<p dir="auto"><code>&lt;title&gt;Why I love! you so much&lt;/title&gt;</code></p>
<p dir="auto">In this case, I want to match the word <em><code>love!</code></em> because has an <code>!</code></p>
<p dir="auto">Now, I made this beautiful regex:</p>
<p dir="auto"><code>(?-s)(&lt;title&gt;)*\w+!(?!\w*;)(?=[^&lt;]*&lt;/title&gt;)</code></p>
<p dir="auto">Now, I want to use this regex, to replace in several .html files all those tags that has <code>!</code> Basicaly, I want to delete them from these tag. I try to replace <code>!</code> wih an emptyspace, like so:</p>
<p dir="auto">Search: <code>(?-s)(&lt;title&gt;)*\w+!(?!\w*;)(?=[^&lt;]*&lt;/title&gt;)</code><br />
Replace by: <code>\1\2(LEAVE EMPTY)</code></p>
<p dir="auto">But doesn’t work. Can anyone help me?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/15201/regex-how-to-replace-the-content-of-a-tag</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 14:47:18 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/15201.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Feb 2018 14:54:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regex: How to replace the content of a tag on Mon, 05 Feb 2018 06:32:36 GMT]]></title><description><![CDATA[<p dir="auto">Search: <code>(?:\G(?!^)|&lt;title&gt;)[^&lt;]*?\K\b!\B</code></p>
<p dir="auto">Replace by: <code>(leave a space)!</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/30009</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30009</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Mon, 05 Feb 2018 06:32:36 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: How to replace the content of a tag on Sun, 04 Feb 2018 10:24:49 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3278">@vasile-caraus</a>,</p>
<p dir="auto">I think that your <strong>regex</strong> S/R is <strong>excessively</strong> complicated ! Why not trying this <strong>simple</strong> one :</p>
<p dir="auto">SEARCH <strong><code>(?i)(?&lt;=\w)!(?=\x20)</code></strong></p>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
<p dir="auto">So, this <strong>search</strong> regex would match any <strong><code>!</code></strong> <strong>symbol</strong>, which is, <strong>both</strong> :</p>
<ul>
<li>
<p dir="auto"><strong>Preceded</strong> by a <strong>word</strong> character, whatever its <strong>case</strong>, due to the <strong><code>(?i)</code></strong> <strong>modifier</strong></p>
</li>
<li>
<p dir="auto"><strong>Followed</strong> by a <strong>space</strong> character</p>
</li>
</ul>
<p dir="auto">and would be <strong>deleted</strong>, as the <strong>replacement</strong> zone is <strong>empty</strong> !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29990</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29990</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 04 Feb 2018 10:24:49 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: How to replace the content of a tag on Sat, 03 Feb 2018 15:00:29 GMT]]></title><description><![CDATA[<p dir="auto">After replace, My tag should loook like:</p>
<p dir="auto"><code>&lt;title&gt;Why I love you so much&lt;/title&gt;</code>  (without <code>!</code>)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/29984</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/29984</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Sat, 03 Feb 2018 15:00:29 GMT</pubDate></item></channel></rss>