<?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[Find and Replace Colon Between Numbers]]></title><description><![CDATA[<p dir="auto">Hello all,</p>
<p dir="auto">I would like to do find and replace:</p>
<ol>
<li>Colon between numbers</li>
<li>Dash between numbers</li>
</ol>
<p dir="auto">Original:<br />
Matthew 22:23-33</p>
<p dir="auto">Become:<br />
Matthew 22 <strong>verse</strong> 23 <strong>to</strong> 33</p>
<p dir="auto">But it does not have impact to other word if it is not between numbers, example= God:</p>
<p dir="auto">Please let me know, thank you in advance.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18514/find-and-replace-colon-between-numbers</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 06:40:05 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18514.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Nov 2019 17:20:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find and Replace Colon Between Numbers on Sat, 16 Nov 2019 16:08:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/yohanes-k" aria-label="Profile: yohanes-k">@<bdi>yohanes-k</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/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Oh, my bad ! Reading again my post, I just realize that I’m quite <strong>wrong</strong> and that the <strong>Peter</strong>’s solution is the <strong>right</strong> one !</p>
<p dir="auto">Why ? because my search regex, in fact, is an <strong>alternative</strong> between the <strong><code>2</code></strong> <strong>independent</strong> regexes : <strong><code>\d+\K(:)</code></strong> and <strong><code>-(?=\d+)</code></strong> :-((</p>
<p dir="auto">Actually, the <strong>overall</strong> regex must be an <strong>alternative</strong> between the regexes <strong><code>\d+\K:(?=\d+)</code></strong> and <strong><code>\d+\K-(?=\d+)</code></strong> which may be <strong>grouped</strong> with a ( <strong>non</strong>-capturing ) <strong>group</strong> syntax !</p>
<hr />
<p dir="auto">Now, in order to be more <strong>rigorous</strong>, we should mention the name of the <strong>Four Evangelists</strong>. This gives the following regex <strong>S/R</strong> :</p>
<p dir="auto">SEARCH <strong><code>(?-i:Matthew|Mark|Luke|John)\x20\d+\K:(\d+)-(?=\d+)</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20verse\x20\1\x20to\x20</code></strong></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48539</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48539</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 16 Nov 2019 16:08:25 GMT</pubDate></item><item><title><![CDATA[Reply to Find and Replace Colon Between Numbers on Sat, 16 Nov 2019 10:17:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/yohanes-k" aria-label="Profile: yohanes-k">@<bdi>yohanes-k</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"><strong>Peter</strong>, you could, even, have omitted the <strong>non-capturing</strong> group, giving :</p>
<p dir="auto">SEARCH <strong><code>\d+\K(:)|-(?=\d+)</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20(?1verse:to)\x20</code></strong></p>
<p dir="auto">Be aware, <a class="plugin-mentions-user plugin-mentions-a" href="/user/yohanes-k" aria-label="Profile: yohanes-k">@<bdi>yohanes-k</bdi></a>, to click, <strong>exclusively</strong>, on the <strong><code>Replace All</code></strong> button ( Due to the <strong><code>\K</code></strong> syntax, the <strong>step by step</strong> <strong><code>Replace</code></strong> button does <strong>not</strong> work properly ! )</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/48535</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48535</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 16 Nov 2019 10:17:14 GMT</pubDate></item><item><title><![CDATA[Reply to Find and Replace Colon Between Numbers on Fri, 15 Nov 2019 21:23:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yohanes-k" aria-label="Profile: Yohanes-K">@<bdi>Yohanes-K</bdi></a>,</p>
<pre><code>Matthew 22:23-33

God said: "Let-there-be-light"

Score 15-17

Gen 1:1

Boring: text
</code></pre>
<p dir="auto">becomes</p>
<pre><code>Matthew 22 verse 23 to 33

God said: "Let-there-be-light"

Score 15 to 17

Gen 1 verse 1

Boring: text
</code></pre>
<p dir="auto">using</p>
<ul>
<li>search mode = regular expression</li>
<li>find = <code>\d+\K(?:(:)|(-))(?=\d)</code></li>
<li>replace = <code>(?1 verse )(?2 to )</code> – yes, there are spaces around “verse” and “to” in that expression; copy-paste should work right</li>
</ul>
<p dir="auto">Quick explanation:</p>
<ul>
<li>find one or more digits,</li>
<li>reset the search, so those digits aren’t included in the “match text”</li>
<li>look for either <code>:</code> (which will be called group 1) or <code>-</code> (which will be called group 2)</li>
<li>followed by another digit (but don’t keep this digit in the match, either</li>
<li>replace group 1 (if any <code>:</code> matched) with " verse " (including spaces)</li>
<li>replace group 2 (if any <code>-</code> matched) with " to " (including spaces)</li>
</ul>
<p dir="auto">Notice my example used counter-examples which don’t match, but might mistakenly do so with a less-than-ideal regex; this makes it much more clear whether the expression is working, or just <em>seems</em> to be working on the positive-match data.</p>
<p dir="auto">-----</p>
<h3>Please Read And Understand This</h3>
<p dir="auto">FYI: I often add this to my response in regex threads, unless I am sure the original poster has seen it before.  Here is some helpful information for finding out more about regular expressions, and for formatting posts in this forum (especially quoting data) so that we can fully understand what you’re trying to ask:</p>
<blockquote>
<p dir="auto">This forum is formatted using <a href="https://daringfireball.net/projects/markdown/syntax" rel="nofollow ugc">Markdown</a>.  Fortunately, it has a formatting toolbar above the edit window, and a preview window to the right; make use of those.  The <code>&lt;/&gt;</code> button formats text as “code”, so that the text you format with that button will come through literally; use that formatting for example text that you want to make sure comes through literally, no matter what characters you use in the text (otherwise, the forum might interpret your example text as Markdown, with unexpected-for-you results, giving us a bad indication of what your data really is).  Images can be pasted directly into your post, or you can hit the image button. (For more about how to manually use Markdown in this forum, please see <a href="https://notepad-plus-plus.org/community/topic/14262/how-to-markdown-code-on-this-forum/4" rel="nofollow ugc">@Scott-Sumner’s post in the “how to markdown code on this forum” topic</a>, and my updates <a href="https://notepad-plus-plus.org/community/topic/14262/how-to-markdown-code-on-this-forum/9" rel="nofollow ugc">near the end</a>.)  Please use the preview window on the right to confirm that your text looks right before hitting SUBMIT.  If you want to clearly communicate your text data to us, you <em>need</em> to properly format it.</p>
</blockquote>
<blockquote>
<p dir="auto">If you have further search-and-replace (“matching”, “marking”, “bookmarking”, regular expression, “regex”) needs, study <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">the official Notepad++ searching using regular-expressions docs</a>, as well as <a href="https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation" rel="nofollow ugc">this forum’s FAQ</a> and the documentation it points to.  Before asking a new regex question, understand that for future requests, many of us will expect you to show what data you have (exactly), what data you want (exactly), what regex you already tried (to show that you’re showing effort), why you thought that regex would work (to prove it wasn’t just something randomly typed), and what data you’re getting with an explanation of why that result is wrong. When you show that effort, you’ll see us bend over backward to get things working for you.  If you need help formatting, see the paragraph above.</p>
</blockquote>
<blockquote>
<p dir="auto">Please note that for all regex and related queries, it is best if you are explicit about what needs to match, <em>and</em> what <em>shouldn’t</em> match, and have multiple examples of both in your example dataset.  Often, what <em>shouldn’t match</em> helps define the regular expression as much or more than what <em>should match</em>.</p>
</blockquote>
]]></description><link>https://community.notepad-plus-plus.org/post/48532</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/48532</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 15 Nov 2019 21:23:22 GMT</pubDate></item></channel></rss>