<?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[Плагин расширенного поиска]]></title><description><![CDATA[<p dir="auto">Добрый день.<br />
При работе с поиском и заменой текста регулярно возникают задачи, которые не решает стандартный поиск.<br />
К примеру:</p>
<ol>
<li>надо найти текст-1 и от текста-1 найти вверх или вниз вхождение текста-2 и далее заменить текст-1 или текст-2 на текст-3.</li>
<li>надо найти текст-1 и от текста-1 переместиться на заданное количество символов влево или вправо и далее сделать замену начиная с этой позиции</li>
</ol>
<p dir="auto">Выше приведенные поиск и замену, можно сделать рекурсивным на заданную глубину.</p>
<p dir="auto">Есть ли плагин в Notepad, который решает такие задачи ?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22948/плагин-расширенного-поиска</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 16:57:00 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22948.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 May 2022 04:25:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Плагин расширенного поиска on Wed, 04 May 2022 14:27:10 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/pavel-san" aria-label="Profile: pavel-san">@<bdi>pavel-san</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: terry-r">@<bdi>terry-r</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">As <a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: terry-r">@<bdi>terry-r</bdi></a> said, there are a <strong>lot</strong> of questions concerning your requests !!</p>
<p dir="auto">First, when you speak of <strong><code>text-1</code></strong> do you mean :</p>
<ul>
<li>
<p dir="auto">The <strong>word</strong>, as in the sentence  “This <strong><code>abc text-1 xyz</code></strong> is <strong>right</strong>, but <strong>not</strong> <strong><code>abctext-1xyz</code></strong>”</p>
</li>
<li>
<p dir="auto">The <strong>string</strong> as in the sentence “This <strong><code>abctext-1xyz</code></strong> is <strong>right</strong>, as well as <strong><code>abc text-1 xyz</code></strong>”</p>
</li>
</ul>
<p dir="auto">Secondly, do you mind about the <strong>case</strong> of letters in <strong><code>text-1</code></strong> and/or <strong><code>text-2</code></strong> ?</p>
<p dir="auto">In other words, must the string <strong><code>text-1</code></strong> have :</p>
<ul>
<li>
<p dir="auto">The <strong>exact</strong> case <strong><code>text-1</code></strong></p>
</li>
<li>
<p dir="auto">Are the <strong><code>Text-1</code></strong>, <strong><code>TEXT-1</code></strong>, <strong><code>text-1</code></strong> and <strong><code>tExT-1</code></strong> syntaxes all <strong>OK</strong> ?</p>
</li>
</ul>
<p dir="auto">Idem for <strong><code>text-2</code></strong> !</p>
<hr />
<p dir="auto">Now, your <strong>first</strong> statement :</p>
<blockquote>
<p dir="auto">you need to find text-1 and from text-1 find up or down the occurrence of text-2 and then replace text-1 or text-2 with text-3.</p>
</blockquote>
<p dir="auto">can be slipt into <strong>two</strong> different goals :</p>
<ul>
<li>
<p dir="auto">(<strong>A</strong>) you need to find <strong><code>text-1</code></strong> and from <strong><code>text-1</code></strong> find up or down the occurrence of <strong><code>text-2</code></strong> and then replace <strong><code>text-1</code></strong> with <strong><code>text-3</code></strong></p>
</li>
<li>
<p dir="auto">(<strong>B</strong>) you need to find <strong><code>text-1</code></strong> and from <strong><code>text-1</code></strong> find up or down the occurrence of <strong><code>text-2</code></strong> and then replace <strong><code>text-2</code></strong> with <strong><code>text 3</code></strong></p>
</li>
</ul>
<p dir="auto">But, in this case, this could <strong>also</strong> be expressed as :</p>
<ul>
<li>
<p dir="auto">(<strong>A</strong>) Change <strong><code>text-1</code></strong> with <strong><code>text-3</code></strong>, if <strong>current</strong> file contains, at least, <strong>one</strong> occurrence of <strong><code>text-2</code></strong></p>
</li>
<li>
<p dir="auto">(<strong>B</strong>) Change <strong><code>text-2</code></strong> with <strong><code>text-3</code></strong>, if <strong>current</strong> file contains, at least, <strong>one</strong> occurrence of <strong><code>text-1</code></strong></p>
</li>
</ul>
<hr />
<p dir="auto">Case (<strong>A</strong>) could be achieved with the <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?s)(?=.*text-2).*?\Ktext-1</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>text-3</code></strong></p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Wrap-around</code></strong> option</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Click <strong>once</strong> on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<hr />
<p dir="auto">Case (<strong>B</strong>) could be achieved with the <strong>regex</strong> S/R :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?s)(?=.*text-1).*?\Ktext-2</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>text-3</code></strong></p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Wrap-around</code></strong> option</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Click <strong>once</strong> on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
<hr />
<p dir="auto">Finally, your <strong>second</strong> statement is :</p>
<blockquote>
<p dir="auto">You have to find text-1, and then move from the text-1 to the left or to the right by a given number of characters, and then replace it starting from this position</p>
</blockquote>
<p dir="auto">Many questions !</p>
<ul>
<li>
<p dir="auto">Do you want to find <strong>all</strong> occurrences of <strong><code>text-1</code></strong> or a <strong>specific</strong> one ?</p>
</li>
<li>
<p dir="auto"><strong>What</strong> you want to replace ( an exact <strong>number</strong> of chars, the next <strong>word</strong>, an exact <strong>string</strong> or even some text splited on <strong>several</strong> lines ? )</p>
</li>
</ul>
<p dir="auto">Anyway, here is a <strong>first</strong> idea :</p>
<ul>
<li>To get the <strong>zero-length</strong> position, after <strong><code>text-1</code></strong> and <strong><code>N</code></strong> characters on the <strong>right</strong>, use the search regex :</li>
</ul>
<p dir="auto"><strong><code>(?-s)text-1.{</code>N<code>}\K</code></strong></p>
<ul>
<li>To get the <strong>zero-length</strong> position, before <strong><code>text-1</code></strong> and <strong><code>N</code></strong> characters on the <strong>left</strong>, use the search regex :</li>
</ul>
<p dir="auto"><strong><code>(?-s)\K(?=.{</code>N<code>}text-1)</code></strong></p>
<p dir="auto">See you later,</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76635</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76635</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 04 May 2022 14:27:10 GMT</pubDate></item><item><title><![CDATA[Reply to Плагин расширенного поиска on Wed, 04 May 2022 13:05:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pavel-san" aria-label="Profile: pavel-san">@<bdi>pavel-san</bdi></a></p>
<p dir="auto">I used Google translate on your post to get:</p>
<blockquote>
<p dir="auto">Good afternoon.<br />
When working with text search and replacement, tasks regularly arise that the standard search does not solve.<br />
For example:</p>
<ol>
<li>you need to find text-1 and from text-1 find up or down the occurrence of text-2 and then replace text-1 or text-2 with text-3.</li>
<li>you need to find text-1 and move from text-1 to the specified number of characters to the left or right and then make a replacement starting from this position</li>
</ol>
<p dir="auto">The above search and replace can be made recursive to a given depth.</p>
<p dir="auto">Is there a plugin in Notepad that solves this problem?</p>
</blockquote>
<p dir="auto">The forum does ask that you post in English preferably. Since it is you who wants help this would be the polite thing to do.</p>
<p dir="auto">So if the translation is correct then it does seem possible to complete the tasks with regular expressions. However without concrete examples it is doubtful you will get any help.</p>
<p dir="auto">Read the pinned post at the start of the “Help Wanted” section called “Please Read This Before Posting” on how to provide examples and you may get shown how to do it.  The Help Wanted section would be a more accurate area to post in.</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76633</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76633</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 04 May 2022 13:05:44 GMT</pubDate></item></channel></rss>