<?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[Need help replacing HTML tags! Any help welcome.]]></title><description><![CDATA[<p dir="auto">I need help with replacing and removing a series of HTML tags for 500+ excel cells.</p>
<ul>
<li>There are HTML tags that I need to replace with new tag names and there are tags that I would like to remove altogether.</li>
<li>The text I need to format is case sensitive, and in some cases, the tags contain capitalization. I need to replace all capitalized tags to lower-case lettering.</li>
<li>Lastly, some tags have additional formatting included within the tag, but I would like to simplify them to their most basic tag naming convention. An asterisk is noted in some tags to indicate wildcard HTML tags where I would like to replace all variations of that tag that start the way I indicated.</li>
</ul>
<p dir="auto">There are variations of the following tags but here are just a few examples:</p>
<p dir="auto">Find and Replace:<br />
Find  &lt;DIV style…&gt; and replace with &lt;DIV&gt;<br />
Find &lt;STRONG&gt; and replace with &lt;b&gt;<br />
Find &lt;SPAN lang*&gt; and replace with &lt;span&gt;</p>
<p dir="auto">Remove Altogether:<br />
&lt;FONT Style…&gt; and &lt;/FONT&gt;<br />
&lt;tbody*&gt; and &lt;/tbody&gt;</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14675/need-help-replacing-html-tags-any-help-welcome</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 03:53:03 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14675.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Oct 2017 21:31:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Need help replacing HTML tags! Any help welcome. on Wed, 25 Oct 2017 22:11:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi, @carolin-marschke,</p>
<p dir="auto">I supposed that you’re speaking about the <strong>tag</strong> , as below, which starts, generally, an <strong>XML</strong> file  !</p>
<p dir="auto"><strong>&lt;?xml version=“1.0” encoding=“UTF-8” ?&gt;</strong></p>
<p dir="auto">Your troubles come from the <strong>Question mark</strong> character ( <strong><code>?</code></strong> ), which is considered, in the regex universe, as a <strong>special</strong> character, also called a <strong>meta-character</strong>. So, by default, these characters are <strong>NOT</strong> simple <strong>literal</strong> characters !</p>
<hr />
<p dir="auto">There are <strong><code>two</code></strong> different sets of <strong>meta-characters</strong> :</p>
<ul>
<li>
<p dir="auto">Those, which are recognized <strong>anywhere</strong> in the pattern, EXCEPT <strong>within square</strong> brackets :</p>
<ul>
<li>
<p dir="auto"><strong><code>\</code></strong> General <strong>escape</strong> character, with <strong>several</strong> uses</p>
</li>
<li>
<p dir="auto"><strong><code>^</code></strong> <strong>Start</strong> of a line ( or a file )</p>
</li>
<li>
<p dir="auto"><strong><code>$</code></strong> <strong>End</strong> of a line ( or a file )</p>
</li>
<li>
<p dir="auto"><strong><code>.</code></strong> Match <strong>any</strong> character, except  <strong>new-line</strong> ones ( by <strong>default</strong> )</p>
</li>
<li>
<p dir="auto"><strong><code>[</code></strong> Start a <strong>class</strong> definition  or a <strong>class</strong> range</p>
</li>
<li>
<p dir="auto"><strong><code>|</code></strong> Start of an <strong>alternative</strong> branch</p>
</li>
<li>
<p dir="auto"><strong><code>(</code></strong> Start of a <strong>sub-pattern</strong> group</p>
</li>
<li>
<p dir="auto"><strong><code>)</code></strong> End of a <strong>sub-pattern</strong> group</p>
</li>
<li>
<p dir="auto"><strong><code>{</code></strong> Start a <strong><code>Min / Max</code></strong> range of a <strong>quantifier</strong></p>
</li>
<li>
<p dir="auto"><strong><code>}</code></strong> End a <strong>`Min / Max</strong> range of a <strong>quantifier</strong></p>
</li>
<li>
<p dir="auto"><strong><code>*</code></strong> <strong><code>0</code></strong> to <strong><code>more</code></strong> times, the <strong>preceding</strong> character or group</p>
</li>
<li>
<p dir="auto"><strong><code>+</code></strong></p>
<ul>
<li>
<p dir="auto"><strong><code>1</code></strong> to <strong><code>more</code></strong> times, the <strong>preceding</strong> character or group</p>
</li>
<li>
<p dir="auto"><strong>Possessive</strong> behaviour of the quantifiers <strong><code>*</code></strong>, <strong><code>+</code></strong> and <strong><code>?</code></strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto"><strong><code>?</code></strong></p>
<ul>
<li>
<p dir="auto"><strong><code>0</code></strong> or <strong><code>1</code></strong> time, the <strong>preceding</strong> character or group</p>
</li>
<li>
<p dir="auto">Meaning <strong>extender</strong>, for <strong>groups</strong> or <strong>conditions</strong>, <strong><code>(....)</code></strong></p>
</li>
<li>
<p dir="auto"><strong>Minimizer</strong> of the quantifiers <strong><code>*</code></strong>, <strong><code>+</code></strong> and <strong><code>?</code></strong></p>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p dir="auto">Those, which are recognized <strong>within square</strong> brackets ( <strong>character class</strong> ), EXCLUSIVELY :</p>
<ul>
<li>
<p dir="auto"><strong><code>\</code></strong> General <strong>escape</strong> character</p>
</li>
<li>
<p dir="auto"><strong><code>^</code></strong> <strong>Negate</strong> the class, if <strong>first</strong> character of the class</p>
</li>
<li>
<p dir="auto"><strong><code>-</code></strong> Character <strong>range</strong> indicator</p>
</li>
<li>
<p dir="auto"><strong><code>[:</code></strong> Start of a <strong>POSIX</strong> character class, if followed by regular <strong>POSIX</strong> syntax</p>
</li>
<li>
<p dir="auto"><strong><code>:]</code></strong> End of a <strong>POSIX</strong> character class</p>
</li>
</ul>
</li>
</ul>
<p dir="auto">So, <strong>Carolin</strong>, if you need to search for any of the <strong>above</strong> characters, as a <strong>literal</strong>, you must <strong>escape</strong> it with the <strong>backslash</strong> character <strong><code>\</code></strong></p>
<p dir="auto">Therefore, your regex must be rewritten as : <strong><code>(?i)&lt;\?xml[^&gt;]*&gt;</code></strong>, with a <strong><code>\</code></strong>, right <strong>before</strong> the <strong><code>?</code></strong> character !</p>
<p dir="auto">However, the regex <strong><code>(?-is)&lt;\?xml.+?&gt;</code></strong> give <strong>better</strong> results ! Indeed, due to the <strong><code>-s</code></strong> modifier, any <strong>dot</strong> will match <strong>standard</strong> characters, only, with <strong>case</strong> sensitivity. So, after matching the <strong>literal</strong> string <strong>&lt;?xml</strong>, with that <strong>exact</strong> case ( <strong><code>&lt;\?xml</code></strong> ), it looks for the <strong>shortest non-null</strong> range of characters ( <strong><code>.+?</code></strong> ), of the <strong>current</strong> line, till a <strong>closing</strong> symbol <strong><code>&gt;</code></strong></p>
<p dir="auto">Assuming that the <strong>unique</strong> XML line <strong>&lt;?xml version=“1.0” encoding=“UTF-8” ?&gt;</strong> would be split into the <strong>four</strong> lines, as below :</p>
<pre><code class="language-diff">&lt;?xml ver
sion="1.0" enc
oding="UT
F-8" ?&gt;
</code></pre>
<p dir="auto">My regex doesn’t match this <strong>incorrect</strong> text, unlike your regex ! To get the <strong>same</strong> behaviour, you should change your regex as  <strong><code>(?i)&lt;\?xml[^&gt;\r\n]*&gt;</code></strong>. This time, the syntax <strong><code>[^&gt;\r\n]</code></strong> matches <strong>any</strong> character, different from the <strong><code>&gt;</code></strong> character AND different, also, from any <strong>EOL</strong> character :-))</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27619</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27619</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 25 Oct 2017 22:11:54 GMT</pubDate></item><item><title><![CDATA[Reply to Need help replacing HTML tags! Any help welcome. on Wed, 25 Oct 2017 18:43:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> ,</p>
<p dir="auto">Hello! Thank you again for your help. I am now stumbling upon an issue with the following tag (any possible variations of it after the first few characters):</p>
<p dir="auto">&lt;?xml *&gt;</p>
<p dir="auto">There may be variations of strings that begin with this lettering. I tried to replace these by the following search function:</p>
<p dir="auto">(?i)&lt;?xml[^&gt;]*&gt;</p>
<p dir="auto">But once replaced, the following remained in my script:<br />
<strong>&lt;?</strong></p>
<p dir="auto">How do you recommend I remove all instances of " <strong>&lt;?</strong> " ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27615</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27615</guid><dc:creator><![CDATA[Girlswhocode312]]></dc:creator><pubDate>Wed, 25 Oct 2017 18:43:38 GMT</pubDate></item><item><title><![CDATA[Reply to Need help replacing HTML tags! Any help welcome. on Tue, 24 Oct 2017 17:29:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> ,</p>
<p dir="auto">Thank you very much for your response. Also, you are correct in catching my mistake. Thanks for pointing that out. I will use your suggestions and get back to you shortly to let you know if those worked for me.</p>
<p dir="auto">Best,</p>
<p dir="auto">Carolin</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27574</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27574</guid><dc:creator><![CDATA[Girlswhocode312]]></dc:creator><pubDate>Tue, 24 Oct 2017 17:29:14 GMT</pubDate></item><item><title><![CDATA[Reply to Need help replacing HTML tags! Any help welcome. on Tue, 24 Oct 2017 12:50:56 GMT]]></title><description><![CDATA[<p dir="auto">Hello, @carolin-marschke,</p>
<p dir="auto">REading <strong>carefully</strong> your post, I noticed a <strong>small</strong> contradiction ! You said :</p>
<blockquote>
<p dir="auto">I need to replace all capitalized tags to lower-case lettering.</p>
</blockquote>
<p dir="auto">And, further on, the example :</p>
<blockquote>
<p dir="auto">Find &lt;DIV style…&gt; and replace with &lt;DIV&gt;</p>
</blockquote>
<p dir="auto">So, I supposed that <strong>replacement</strong> should be <strong>&lt;div&gt;</strong> !</p>
<p dir="auto">Anyway, for all your text <strong>manipulations</strong>, here are some <strong>appropriate</strong> regexes to run, after opening the <strong>Replace</strong> dialog and checking the <strong>Regular exprssion</strong> search mode :</p>
<hr />
<ul>
<li>For <strong>changes</strong>, as :</li>
</ul>
<blockquote>
<p dir="auto">Find &lt;DIV style…&gt; and replace with &lt;DIV&gt;<br />
Find &lt;SPAN lang*&gt; and replace with &lt;span&gt;</p>
</blockquote>
<p dir="auto">Use the <strong>regex</strong> S/R : SEARCH = <strong><code>(?i-s)&lt;(SPAN|DIV).*?&gt;</code></strong> and REPLACE = <strong><code>&lt;\L\1&gt;</code></strong></p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">Search is <strong>non-insensitive</strong> ( <strong><code>i</code></strong> ) and the <strong>dot</strong> matches <strong>any standard</strong> character only (<strong><code>-s</code></strong> )</p>
</li>
<li>
<p dir="auto">It looks for the <strong>tag</strong> SPAN or DIV, in <strong>any</strong> case, stored as <strong>group 1</strong> ( <strong><code>&lt;(SPAN|DIV)</code></strong> ), <strong>possibly</strong> followed by some characters, till the <strong>nearest</strong> <strong><code>&gt;</code></strong> closing tag ( <strong><code>.*?&gt;</code></strong> ), in the <strong>same</strong> line</p>
</li>
<li>
<p dir="auto">In replacement, it just rewrites the <strong>group 1</strong> tag ( <strong><code>\1</code></strong> ), in <strong>lower</strong> case, due to the preceding syntax <strong><code>\L</code></strong></p>
</li>
</ul>
<hr />
<ul>
<li>For <strong>changes</strong>, as :</li>
</ul>
<blockquote>
<p dir="auto">Find &lt;STRONG&gt; and replace with &lt;b&gt;</p>
</blockquote>
<p dir="auto">Use, for instance, the <strong>regex</strong> S/R : SEARCH = <strong><code>(?i)(&lt;strong&gt;)|(&lt;em&gt;)</code></strong> and REPLACE = <strong><code>(?1&lt;b&gt;)(?2&lt;i&gt;)</code></strong></p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li><strong>Simple</strong> change of a string by an <strong>another</strong> one !. The <strong>general</strong> syntax is :</li>
</ul>
<p dir="auto">SEARCH = <strong><code>(?i)(Word1)|(Word2)|(Word3)........|(Wordn)</code></strong></p>
<p dir="auto">REPLACE = <strong><code>(?1subst1)(?2subst2)(?3subst3)........(?nsubstn)</code></strong></p>
<hr />
<p dir="auto">For <strong>suppressions</strong> as :</p>
<blockquote>
<p dir="auto">&lt;FONT Style…&gt; and &lt;/FONT&gt;<br />
&lt;tbody*&gt; and &lt;/tbody&gt;</p>
</blockquote>
<p dir="auto">Use the <strong>regex</strong> S/R : SEARCH = <strong><code>(?is)&lt;(FONT|tbody).+?&lt;/\1&gt;\R?</code></strong> and REPLACE = <strong><code>EMPTY</code></strong></p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">Search is <strong>non-insensitive</strong> ( <strong><code>i</code></strong> ) and the <strong>dot</strong> matches <strong>any</strong> character ( <strong>standard</strong> or <strong>EOL</strong> ones ) (<strong><code>s</code></strong> )</p>
</li>
<li>
<p dir="auto">It looks for tags <strong>FONT</strong> or <strong>tbody</strong>, in <strong>any</strong> case, stored as <strong>group 1</strong> ( <strong><code>&lt;(FONT|tbody)</code></strong> ), till the <strong>nearest</strong> closing IDENTICAL <strong>group 1</strong> tag ( <strong><code>&lt;/\1&gt;</code></strong> ), <strong>possibly</strong> followed by <strong>EOL</strong> characters(s) ( <strong><code>\R?</code></strong> )</p>
</li>
<li>
<p dir="auto">As the <strong>replacement</strong> zone is <strong>empty</strong>, the bloc <strong><code>&lt;Tag...&gt;.......&lt;/Tag&gt;</code></strong>, most of a time, <strong>multi-lines</strong>,  is simply <strong>deleted</strong></p>
</li>
</ul>
<hr />
<p dir="auto">Hoping that this <strong>first</strong> attempt will be <strong>useful</strong> to you !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27568</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27568</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 24 Oct 2017 12:50:56 GMT</pubDate></item></channel></rss>