<?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: Delete all signs/operator like (comma) from tags < >]]></title><description><![CDATA[<p dir="auto">hello. I have to delete all commas from tags:</p>
<pre><code>&lt;!DOCTYPE, html&gt;
&lt;html, xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ro"&gt;
&lt;title&gt;I, love, Myself, Now | Nick, Francisco&lt;/title&gt;
&lt;meta, property="fb:admins" content="1446157242"/&gt;
&lt;link, rel="sitemap" type="application/rss+xml" href="rss.xml" /&gt; 
&lt;meta, name="googlebot" content="index,follow"/&gt;
&lt;link, rel="shortcut, icon" href="goiu.ico"/&gt;
&lt;meta, http-equiv="X-UA-Compatible" content="IE=edge"/&gt;
</code></pre>
<p dir="auto">I made a regex, but is not too good.</p>
<p dir="auto">FIND: <code>(?-s)(\G(?!^)|&lt;,)((?!/&gt;).)*?\K\s\s+</code></p>
<p dir="auto">REPLACE BY: <code>(leave empty)</code></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18970/regex-delete-all-signs-operator-like-comma-from-tags</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 19:20:06 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18970.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Feb 2020 08:45:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Sat, 29 Feb 2020 14:15:21 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> said in <a href="/post/51052">Regex: Delete all signs/operator like (comma) from tags &lt; &gt;</a>:</p>
<blockquote>
<p dir="auto">(&lt;|\G)[^&gt;\r\n]+?\K,</p>
</blockquote>
<p dir="auto">thanks a lot, <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/51061</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51061</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Sat, 29 Feb 2020 14:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Fri, 28 Feb 2020 22:15:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: vasile-caraus">@<bdi>vasile-caraus</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: vasile-caraus">@<bdi>vasile-caraus</bdi></a>, let me show you <strong>how</strong> you could have written your <strong>initial</strong> post, in order to get a <strong>quick</strong> response from the <strong>N++ Community</strong> ;-))</p>
<hr />
<p dir="auto">Hello, guys,</p>
<p dir="auto">Let’s assume that I have an <strong>initial</strong> text, as below :</p>
<pre><code class="language-html">    &lt;div&gt;
        &lt;font face="arial, verdana, tahoma, trebuchet" size="25"&gt;
            &lt;font face="Comic Sans MS" size="2,5"&gt;
                &lt;font size="2,5"&gt;
                    &lt;span class="1184,6401,5220"&gt;Text2, with commas, for 1, or several, regex tests&lt;/span&gt;
                &lt;/font&gt;
            &lt;/font&gt;
        &lt;/font&gt;
    &lt;/div&gt;
</code></pre>
<p dir="auto">I’m trying to get this <strong>output</strong> text ( Certainly <strong>not</strong> a <strong>valid</strong> <strong><code>HTMlL</code></strong> code and just for explanations ! )</p>
<pre><code class="language-html">    &lt;div&gt;
        &lt;font face="arial verdana tahoma trebuchet" size="25"&gt;
            &lt;font face="Comic Sans MS" size="25"&gt;
                &lt;font size="25"&gt;
                    &lt;span class="118464015220"&gt;Text, with commas, for 1, or several, regex tests&lt;/span&gt;
                &lt;/font&gt;
            &lt;/font&gt;
        &lt;/font&gt;
    &lt;/div&gt;
</code></pre>
<p dir="auto">As you can see, I would like to <strong>delete</strong> any <strong>comma</strong> symbol, which is inside any <strong>tag</strong> zone <strong><code>&lt;........&gt;</code></strong>.</p>
<p dir="auto">However, <strong>commas</strong>, laying <strong>outside</strong> <strong><code>&lt;......&gt;</code></strong> zones, would <strong>not</strong> be suppressed, as in the range <strong><code>Text, with commas, for 1, or several, regex tests</code></strong> in the <strong><code>5th</code></strong> line of the <strong>output</strong> text !</p>
<p dir="auto">I already tried the <strong>regex</strong> S/R, below, without <strong>complete</strong> success, because, sometimes, it <strong>just</strong> deletes the <strong>last</strong> comma of the <strong>current</strong> tag and not <strong>all</strong> :-((</p>
<p dir="auto">FIND <strong><code>(&lt;[^&gt;\r\n]+),</code></strong></p>
<p dir="auto">REPLACE BY <strong><code>\1</code></strong></p>
<hr />
<p dir="auto">Could you please, tell me what is the <strong>correct</strong> regex to process or, at least, point me in the <strong>right</strong> direction ? Many <strong>thanks</strong> for your future help !</p>
<p dir="auto">Best regards,</p>
<p dir="auto">Vasile Caraus</p>
<hr />
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">The <strong>most</strong> important thing, <strong>Vasile</strong>, is to show, at the <strong>same</strong> time, a general view of your <strong>initial</strong> text <em>AND</em> of the <strong>output</strong> text, that you <strong>expect</strong> to !</p>
<hr />
<p dir="auto">Now, your <strong>search</strong> regex <strong><code>(&lt;\w+|\G)((?!&gt;).)*?\K,</code></strong> does act as <strong>expected</strong> and leave you with the <strong>output</strong> text, above !</p>
<p dir="auto">I even found out an <strong>alternate</strong> and <strong>shorter</strong> syntax, which does <strong>not</strong> need the <strong>negative</strong> look-ahead <strong><code>(?!&gt;)</code></strong> and use, instead, a <strong>negative class</strong> character <strong><code>[^&gt;\r\n]</code></strong></p>
<p dir="auto">SEARCH <strong><code>(&lt;|\G)[^&gt;\r\n]+?\K,</code></strong></p>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/51052</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51052</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 28 Feb 2020 22:15:47 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Fri, 28 Feb 2020 14:37:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<p dir="auto">I think it’s probably best that in the future <a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: Vasile-Caraus">@<bdi>Vasile-Caraus</bdi></a> <em>NOT</em> post here, but rather go wherever-else he’s getting the answers he needs.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/51043</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51043</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 28 Feb 2020 14:37:44 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Fri, 28 Feb 2020 14:17:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: Vasile-Caraus">@<bdi>Vasile-Caraus</bdi></a> said in <a href="/post/51037">Regex: Delete all signs/operator like (comma) from tags &lt; &gt;</a>:</p>
<blockquote>
<p dir="auto">somebody else gives me the right answer.</p>
</blockquote>
<p dir="auto">It would’ve been nice if you had linked that “somebody else”'s reply, since it obviously wasn’t in this thread.</p>
<p dir="auto">Taking that regular expression as “golden”, I can now answer the questions that you refused to answer: you wanted <em>any</em> comma inside the angle brackets <code>&lt;...&gt;</code> to be removed, whether they were inside the quotes are not.  Since you refused to clarify that, despite multiple requests, we couldn’t read your mind (and we were getting tired of being asked to read your mind and do your work for you without any effort on your part).</p>
<p dir="auto">Once again, I will say: if you want help on this (or any) forum, you need to show some effort, and answer the questions that are asked of you to clarify your problem.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/51042</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51042</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 28 Feb 2020 14:17:29 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Fri, 28 Feb 2020 14:04:05 GMT]]></title><description><![CDATA[<p dir="auto">So, somebody else gives me the right answer.</p>
<p dir="auto">Find what: <code>(?:&lt;\w+|\G)(?:(?!&gt;).)*?\K,</code><br />
Replace with: <code>LEAVE EMPTY</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/51037</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51037</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Fri, 28 Feb 2020 14:04:05 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Wed, 26 Feb 2020 22:19:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: Vasile-Caraus">@<bdi>Vasile-Caraus</bdi></a> said in <a href="/post/50991">Regex: Delete all signs/operator like (comma) from tags &lt; &gt;</a>:</p>
<blockquote>
<p dir="auto">must select only … I need strictly</p>
</blockquote>
<p dir="auto">If you want the help, put in the effort.  I outlined what information we would need from you to be able to help you.</p>
<p dir="auto">Since we obviously cannot read your mind, then please provide the information.  Then again, if what you really want is for us to guess wrong so that you feel justified to complain that we haven’t got the right regex, then you are getting exactly what you want – and being very rude to the volunteers trying to help you in the process.</p>
<p dir="auto">I’ve already given you the freebie.  As far as I can tell, based on my interpretation of your desires, my solution will give you exactly what you want.  If it doesn’t, you have to read my entire post, and answer all the questions asked there; otherwise, we cannot help you any better than we already have.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/50995</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50995</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 26 Feb 2020 22:19:30 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Wed, 26 Feb 2020 21:57:31 GMT]]></title><description><![CDATA[<p dir="auto">I think Peter’s reply to <a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: Vasile-Caraus">@<bdi>Vasile-Caraus</bdi></a> 's first posting also applies in response to his second:</p>
<blockquote>
<p dir="auto">You have been around long enough to know how to ask a more complete question than that.</p>
</blockquote>
<p dir="auto">But I’m sure Peter’s reply was TL;DR for <a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: Vasile-Caraus">@<bdi>Vasile-Caraus</bdi></a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/50992</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50992</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 26 Feb 2020 21:57:31 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Wed, 26 Feb 2020 21:53:48 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> said in <a href="/post/50984">Regex: Delete all signs/operator like (comma) from tags &lt; &gt;</a>:</p>
<blockquote>
<p dir="auto">?1$0</p>
</blockquote>
<p dir="auto">hello  <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> . Yes, ok,  but it must select only the comma from tags &lt;&gt;. Your regex is fine, but it selects all comma from my documents. I need strictly from tags &lt;&gt;</p>
]]></description><link>https://community.notepad-plus-plus.org/post/50991</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50991</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Wed, 26 Feb 2020 21:53:48 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Wed, 26 Feb 2020 18:15:07 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/vasile-caraus" aria-label="Profile: vasile-caraus">@<bdi>vasile-caraus</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Do you mean that you want to <strong>delete</strong> any <strong>comma</strong> character <strong><code>,</code></strong>, except when located within <strong><code>2</code></strong> <strong>double quotes</strong> ?</p>
<p dir="auto">If so, use this simple <strong>regex</strong> S/R :</p>
<p dir="auto">SEARCH <strong><code>(?-s)(".+?")|,</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1$0	</code></strong></p>
<p dir="auto">Any <strong>shortest</strong> <strong><code>"........"</code></strong> zone is simply rewritten, <strong>whatever</strong> its contents. Else, if a <strong>comma</strong> is matched, it is <strong>deleted</strong> because <strong>group <code>1</code></strong> does <strong>not</strong> exist ;-))</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/50984</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50984</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 26 Feb 2020 18:15:07 GMT</pubDate></item><item><title><![CDATA[Reply to Regex: Delete all signs/operator like (comma) from tags < > on Wed, 26 Feb 2020 14:23:37 GMT]]></title><description><![CDATA[<p dir="auto">You have been around long enough to know how to ask a more complete question than that.</p>
<p dir="auto">What do you think that regex is doing?  If you hadn’t been around so long, I’d think you were throwing a fake regex at us to try to convince us that you had put effort into the solution when really you hadn’t – but you’ve been here long enough that I hope you wouldn’t be that rude to us.  So, why <em>do</em> you think it would have had any chance of matching your data and doing what you want?  I know you said it didn’t work, but you had to have a reason for thinking it would.</p>
<p dir="auto">I mean, for example, the <code>&lt;,</code> alternation of your regex is obviously never going to match, because you never have <code>&lt;</code> immediately followed by <code>,</code> – so why have it in your regex at all?</p>
<p dir="auto">And the <code>\K</code> resets the match, so the only thing in your matching expression that would possibly be deleted is 2 or more whitespace characters (assuming the condition before the <code>\K</code> is met).  Why do you think that would delete a comma?</p>
<p dir="auto">You’re “spec” is also quite ambiguous.  You gave data you have, but didn’t show what you wanted the data to become, and your phrasing of “delete all commas from tags” is not very specific.  You didn’t say whether you wanted to keep or get rid of the commas in <code>&lt;title&gt;I, love, Myself, Now | Nick, Francisco&lt;/title&gt;</code> – some would say that’s inside the title tag because it’s the content of the title tag, others would say only the stuff inside the angle brackets is inside the title tag.  You didn’t say whether the commas inside <code>content="index,follow"</code> should be deleted – some would say that the value of the attribute is inside the meta tag because it’s between the angle brackets, but others would say that because it’s the value of the attribute it should be left alone.</p>
<p dir="auto">If <em>all</em> you were wanting was getting rid of the obviously invalid-html commas immediately after the tag name, I would use a regex like <code>(?-s)&lt;!?\w+\K,</code> and replace with empty.  This disables dot-matches-newline, requires <code>&lt;</code> or <code>&lt;!</code> followed by one or more word characters, and will throw away the comma if the comma comes immediately after that (because the comma is the only thing after the <code>\K</code>), thus yielding:</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ro"&gt;
&lt;title&gt;I, love, Myself, Now | Nick, Francisco&lt;/title&gt;
&lt;meta property="fb:admins" content="1446157242"/&gt;
&lt;link rel="sitemap" type="application/rss+xml" href="rss.xml" /&gt; 
&lt;meta name="googlebot" content="index,follow"/&gt;
&lt;link rel="shortcut, icon" href="goiu.ico"/&gt;
&lt;meta http-equiv="X-UA-Compatible" content="IE=edge"/&gt;
</code></pre>
<p dir="auto">But if some of the other commas in your examples should also be deleted, or you had a case like <code>&lt;meta name="googlebot", content="xxx"&gt;</code> that you wanted to convert to <code>&lt;meta name="googlebot" content="xxx"&gt;</code> (ie, delete the comma between the attributes), but didn’t bother showing us this completely different condition, then the regex will be very different.</p>
<p dir="auto">So, to sum up, please explain two things:</p>
<ol>
<li>Why did you think the regex you gave us would have a chance of working?</li>
<li>And what is the real definition (“spec”) of what you want to do?  Please describe under what circumstances a comma in your original data should be deleted, and under what circumstances it should be kept.  Show data both before and after the transformation that you want. Make sure that the data has enough of your edge cases so that we can tell what happens to commas in various situations.</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/50962</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50962</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 26 Feb 2020 14:23:37 GMT</pubDate></item></channel></rss>