<?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&#x2F;Replace multiple lines]]></title><description><![CDATA[<p dir="auto">Using Search/Replace I can find “GRID=” in the following text:</p>
<p dir="auto">1 EVEN<br />
2 TYPE FindaGrave<br />
2 NOTE GRID= <strong>somenumber</strong></p>
<p dir="auto">I’d like the replacement to read:</p>
<p dir="auto">1 EVEN<br />
2 TYPE R<br />
2 ADDR <strong>somenumber</strong><br />
2 NOTE GRID=<strong>somenumber</strong></p>
<p dir="auto">I need to be able store “<strong>somenumber</strong>” and use that number (it changes) to create the replacement example multiple times in the text file (it’s a GEDcom file).  Can this be done in one pass?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25268/find-replace-multiple-lines</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 16:47:03 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25268.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Dec 2023 18:43:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find&#x2F;Replace multiple lines on Wed, 20 Dec 2023 18:47:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/29928">@Dave-C-1</a> said in <a href="/post/91365">Find/Replace multiple lines</a>:</p>
<blockquote>
<p dir="auto">Can this be done in one pass?</p>
</blockquote>
<p dir="auto">Using regular expression search, yes.</p>
<p dir="auto">FIND = <code>2 NOTE GRID=(\d+)</code><br />
REPLACE  = <code>2 ADDR $1\r\n$0</code></p>
<p dir="auto">In the FIND, the <code>(\d+)</code> says "find one or more digits and put in group#1)<br />
In the REPLACE, the <code>$1</code> says “use the contents stored in group#1” and the <code>$0</code> says “use the full matched text”</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>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find other regular expressions (regex) documentation</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/91366</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91366</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 20 Dec 2023 18:47:23 GMT</pubDate></item></channel></rss>