<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Удаление дубликатов строк]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17787&amp;type=atom" />
	<updated>2023-05-10T00:16:29Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=17787</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158127#p158127" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Как сделать удаление с конца, пока что не придумал.</p></blockquote></div><p>Похоже, вряд ли такое можно сделать одной регуляркой. Но можно регуляркой в цикле:<br /></p><div class="codebox"><pre><code>Loop
   var := RegExReplace(var, &quot;`asm)^(\V*)$.*\K\R\1$&quot;,, count)
until !count
MsgBox, % var</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-10T00:16:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158127#p158127</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158124#p158124" />
			<content type="html"><![CDATA[<p>Так вроде работает:<br /></p><div class="codebox"><pre><code>MsgBox, % RegExReplace(var, &quot;`asm)^(\V*)\R(?=.*^\1$)&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-09T18:51:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158124#p158124</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158121#p158121" />
			<content type="html"><![CDATA[<p>И первое выражение и второе неверно:<br /></p><div class="codebox"><pre><code>var =
(
34567
345678
)
MsgBox, % RegExReplace(var, &quot;`asm)(^\V*+)\R?(?=.*\1)&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-05-09T18:16:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158121#p158121</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158120#p158120" />
			<content type="html"><![CDATA[<p>В любом случае первое выражение сильно избыточно:<br /></p><div class="codebox"><pre><code>var =
(
345678
345678
123456
234567
234567
456789
456789
567891
123456
234567
567891
345678
123456
123456
123456
)
MsgBox, % RegExReplace(var, &quot;`asm)^(\V*)\R(?=.*^\1$)&quot;)</code></pre></div><p>Как сделать удаление с конца, пока что не придумал.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-09T18:12:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158120#p158120</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158118#p158118" />
			<content type="html"><![CDATA[<p>Парсите построчно и создавайте новый список, проверяя была ли уже данная строка&nbsp; в новом списке.<br />Либо пытайтесь понять, что делает данная комплексная регулярка и переделывайте ее под свои нужды (рекомендую избегать таких сложных).</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-05-09T12:22:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158118#p158118</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158113#p158113" />
			<content type="html"><![CDATA[<p>Воспользовался готовым кодом.</p>]]></content>
			<author>
				<name><![CDATA[john_dease]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42972</uri>
			</author>
			<updated>2023-05-09T08:17:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158113#p158113</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158112#p158112" />
			<content type="html"><![CDATA[<p>А зачем для данной задачи вы используете регулярку?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-05-09T01:55:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158112#p158112</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158110#p158110" />
			<content type="html"><![CDATA[<p>В примере присутствуют одинаковые строки, и в результате работы скрипта одинаковые строки удаляются начиная с начала списка, так что единственная уникальная строка остаётся в том месте списка, где она изначально была последней. Добиться хотелось бы, чтобы происходило наоборот: чтобы дубли удалялись снизу списка, а образец уникальной строки оставался вверху списка.</p>]]></content>
			<author>
				<name><![CDATA[john_dease]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42972</uri>
			</author>
			<updated>2023-05-09T00:42:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158110#p158110</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158109#p158109" />
			<content type="html"><![CDATA[<p>Я не очень понял, какого результата вы хотите добиться в итоге, что должно остаться.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-05-08T23:56:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158109#p158109</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Удаление дубликатов строк]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=158091#p158091" />
			<content type="html"><![CDATA[<p>Пример удаляет дубликаты строк без сортировки, удаляя дубли в начале списка. Как задать удаление дублей в конце списка?<br /></p><div class="codebox"><pre><code>var=
(
345678
345678
123456
234567
234567
456789
456789
567891
123456
234567
567891
345678
123456
123456
123456
)
MsgBox, % RegExReplace(var,&quot;sm`a)^(.*)\1\K^(\R|$)|^(.*)(\R|$)(?=.*^\3)&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[john_dease]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42972</uri>
			</author>
			<updated>2023-05-07T18:53:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=158091#p158091</id>
		</entry>
</feed>
