<?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[Add space after specific character at the beginning of sentence.]]></title><description><![CDATA[<p dir="auto">Hi there.</p>
<p dir="auto">I’m pretty new to the regex-thing, but that’s my own lazy-ass-fault. I’ve been trying to learn it a bit now (holy crap, is it overwhelming…), but I’m somewhat stuck. (see image)</p>
<p dir="auto"><img src="/assets/uploads/files/1732022138176-2024-11-19_141434.png" alt="2024-11-19_141434.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">After every “-” at the beginning of sentence, add a space between “-” and capital letter. (or replace “-” with "- ")</p>
<p dir="auto">These are the lines in the image:</p>
<pre><code>[INPUT]

-Is that good? -That is gooder.
-Scary good, but not gooder-good.
-It was the goodest!
</code></pre>
<pre><code>RegEx used: (-)([A-Z])
Replace with:  "\1 \2"
</code></pre>
<pre><code>[OUTPUT]

- Is that good? - That is gooder.
- Scary good, but not gooder- good.
- It was the goodest!
</code></pre>
<p dir="auto">“gooder- good” should be “gooder-good”. No space here.</p>
<p dir="auto">My logic was: They have in common that every sentence starts with “-” + “A-Z”.  I group “-” and “A-Z” and add a space between them.</p>
<p dir="auto">The regex (-)([A-Z]) works fine in <a href="http://regex101.com" rel="nofollow ugc">regex101.com</a>, see image<br />
(don’t understand why I get a pattern error in Substitution though)</p>
<p dir="auto">Where am I going wrong with this?</p>
<p dir="auto">Thanks for the help in advance.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26379/add-space-after-specific-character-at-the-beginning-of-sentence</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 04:12:13 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26379.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Nov 2024 13:18:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add space after specific character at the beginning of sentence. on Tue, 19 Nov 2024 15:53:09 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> said in <a href="/post/98002">Add space after specific character at the beginning of sentence.</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jajinderk" aria-label="Profile: JajinderK">@<bdi>JajinderK</bdi></a> said in <a href="/post/98000">Add space after specific character at the beginning of sentence.</a>:</p>
<p dir="auto">The Template for Search/Replace FAQ, and the Formatting Forum Posts FAQ (linked below) explain more about how to format your posts for asking these kinds of questions.</p>
<p dir="auto">And the URL for the User Manual’s regex section will be indispensable for someone trying to actually learn how Notepad++ regex work.</p>
</blockquote>
<p dir="auto">Thank you so much for the links. (I hope I won’t give up.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98003</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98003</guid><dc:creator><![CDATA[JajinderK]]></dc:creator><pubDate>Tue, 19 Nov 2024 15:53:09 GMT</pubDate></item><item><title><![CDATA[Reply to Add space after specific character at the beginning of sentence. on Tue, 19 Nov 2024 15:50:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jajinderk" aria-label="Profile: JajinderK">@<bdi>JajinderK</bdi></a> said in <a href="/post/98000">Add space after specific character at the beginning of sentence.</a>:</p>
<blockquote>
<p dir="auto">EDIT: (-)(.|[A-Z]) =&gt; Just learned that \ . (without the space) matched the dot XD</p>
</blockquote>
<p dir="auto">Yes, <code>\.</code> matches the literal dot character.</p>
<p dir="auto">Hint for the forum: put ` backticks around regex, because that makes sure that the forum software won’t change your text.  So <code>`(-)(\.|[A-Z])`</code> will be rendered as <code>(-)(\.|[A-Z])</code> in the forum.</p>
<p dir="auto">(I see that continued edits, it’s getting closer to rendering like you want… good job)</p>
<p dir="auto">The Template for Search/Replace FAQ, and the Formatting Forum Posts FAQ (linked below) explain more about how to format your posts for asking these kinds of questions.</p>
<p dir="auto">And the URL for the User Manual’s regex section will be indispensable for someone trying to actually learn how Notepad++ regex work.</p>
<p dir="auto">-—</p>
<h3>Useful References</h3>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/21965/please-read-before-posting">Please Read Before Posting</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/22022/template-for-search-replace-questions">Template for Search/Replace Questions</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">Formatting Forum Posts</a></li>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/98002</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98002</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Nov 2024 15:50:12 GMT</pubDate></item><item><title><![CDATA[Reply to Add space after specific character at the beginning of sentence. on Tue, 19 Nov 2024 15:48:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/97998">Add space after specific character at the beginning of sentence.</a>:</p>
<blockquote>
<p dir="auto">Soooo many flavors of regex out there (at <em>least</em> this many):</p>
<p dir="auto"><img src="/assets/uploads/files/1732028212382-2bca242a-ba95-4be6-8c69-f7c48fd1ed3a-image.png" alt="2bca242a-ba95-4be6-8c69-f7c48fd1ed3a-image.png" class=" img-fluid img-markdown" /></p>
</blockquote>
<p dir="auto">That is sooooooo not funny.</p>
<p dir="auto">But you gave me great tips regarding the <code>\1</code> and the <code>${1}</code>. Thank you.</p>
<p dir="auto">It’s not only confusing me, it’s infuriating me actually, cause I really want to know how it works, but it’s not that simple if you don’t know the basics. For example the regex I made, is too simple. “What if the next character after the dash is a . (dot)” and I try to fix it with the limited knowledge what I have… uuuuugh. I’m struggling and I try to find examples, but I will get there eventually (I hope, if don’t give up … XD)</p>
<p dir="auto">EDIT: <code>(-)(\.|[A-Z])</code>  =&gt; Just learned that <code>\.</code> matches the dot XD</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98000</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98000</guid><dc:creator><![CDATA[JajinderK]]></dc:creator><pubDate>Tue, 19 Nov 2024 15:48:55 GMT</pubDate></item><item><title><![CDATA[Reply to Add space after specific character at the beginning of sentence. on Tue, 19 Nov 2024 15:03:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jajinderk" aria-label="Profile: JajinderK">@<bdi>JajinderK</bdi></a> said in <a href="/post/97997">Add space after specific character at the beginning of sentence.</a>:</p>
<blockquote>
<p dir="auto">you need to use “$1”, instead of “\1”.</p>
</blockquote>
<p dir="auto">I actually <em>prefer</em> to use <code>$1</code> in Notepad++ (note: it’s valid there) and other places as well.<br />
With <code>\1</code> I start wondering, “do I need to double this backslash the way I’m using this?”.  Using <code>$1</code> there is no “escaping” concern.  Hopefully you know what “escaping” means.</p>
<p dir="auto">In truth, I <em>really</em> prefer <code>${1}</code> because if you need to do <code>$1</code> followed by a literal <code>0</code>, and you try doing <code>$10</code>, you don’t get what you want (you get group 10 instead of group 1).  Use <code>${1}0</code> and you <em>do</em> get what you want.</p>
<hr />
<blockquote>
<p dir="auto">Things are confusing the hell out of me now.</p>
</blockquote>
<p dir="auto">Oh…well…it’s just beginning, man.  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97999</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97999</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Nov 2024 15:03:31 GMT</pubDate></item><item><title><![CDATA[Reply to Add space after specific character at the beginning of sentence. on Tue, 19 Nov 2024 15:23:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jajinderk" aria-label="Profile: JajinderK">@<bdi>JajinderK</bdi></a> said in <a href="/post/97997">Add space after specific character at the beginning of sentence.</a>:</p>
<blockquote>
<p dir="auto">Whish it was a bit more universal.</p>
</blockquote>
<p dir="auto">Soooo many flavors of regex out there (at <em>least</em> this many):</p>
<p dir="auto"><img src="/assets/uploads/files/1732028212382-2bca242a-ba95-4be6-8c69-f7c48fd1ed3a-image.png" alt="2bca242a-ba95-4be6-8c69-f7c48fd1ed3a-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/97998</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97998</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 19 Nov 2024 15:23:24 GMT</pubDate></item><item><title><![CDATA[Reply to Add space after specific character at the beginning of sentence. on Tue, 19 Nov 2024 14:26:22 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">Thank you for noticing that. It fixed my issue.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/97995">Add space after specific character at the beginning of sentence.</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jajinderk" aria-label="Profile: JajinderK">@<bdi>JajinderK</bdi></a> ,</p>
<p dir="auto">First off, Notepad++ uses the Boost regular expression library; regex101 does not; there may be slight differences in syntax between the two.</p>
</blockquote>
<p dir="auto">I just noticed it. Another software I’m using, uses .NET RegEx and for grouping you need to use “$1”, instead of “\1”. Things are confusing the hell out of me now. Whish it was a bit more universal. People changing things for the sake of “because I can” it seems like, but not making it easier.</p>
<p dir="auto">Anyways, thanks again.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97997</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97997</guid><dc:creator><![CDATA[JajinderK]]></dc:creator><pubDate>Tue, 19 Nov 2024 14:26:22 GMT</pubDate></item><item><title><![CDATA[Reply to Add space after specific character at the beginning of sentence. on Tue, 19 Nov 2024 13:52:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jajinderk" aria-label="Profile: JajinderK">@<bdi>JajinderK</bdi></a> ,</p>
<p dir="auto">First off, Notepad++ uses the Boost regular expression library; regex101 does not; there may be slight differences in syntax between the two (though that’s not the cause of your problem, in this case).</p>
<p dir="auto">Your problem is that by default, regex101 uses case-sensitive matching, so <code>[A-Z]</code> only matches uppercase.  However, you have <em>not</em> checkmarked <code>☐ Match case</code> in the Notepad++ <strong>Replace</strong> dialog, so Notepad++ is ignoring case, and thus <code>[A-Z]</code> is actually matching <code>[A-Za-z]</code>.  If you want the regex to pay attention to case, use <code>☑ Match case</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97995</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97995</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Nov 2024 13:52:56 GMT</pubDate></item></channel></rss>