<?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=17597&amp;type=atom" />
	<updated>2023-02-10T15:08:50Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=17597</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156721#p156721" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> вроде все поправил.</p>]]></content>
			<author>
				<name><![CDATA[humanoid]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43005</uri>
			</author>
			<updated>2023-02-10T15:08:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156721#p156721</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156720#p156720" />
			<content type="html"><![CDATA[<p>Только <a href="https://forum.script-coding.com/misc.php?action=rules#literacy">точки ставить</a> не забывайте, у нас строгие требования к оформлению.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-02-10T15:02:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156720#p156720</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156719#p156719" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Спасибо! Буду разбираться с Вашим кодом. )))</p>]]></content>
			<author>
				<name><![CDATA[humanoid]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43005</uri>
			</author>
			<updated>2023-02-10T14:59:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156719#p156719</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156718#p156718" />
			<content type="html"><![CDATA[<p>Обращайтесь! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-02-10T14:57:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156718#p156718</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156717#p156717" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> wow! Кратко, изящно и красиво! Краткость - сестра таланта.))) Большое спасибо!</p>]]></content>
			<author>
				<name><![CDATA[humanoid]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43005</uri>
			</author>
			<updated>2023-02-10T14:52:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156717#p156717</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156716#p156716" />
			<content type="html"><![CDATA[<p>Или такая регулярка, наверно даже правильнее:<br /></p><div class="codebox"><pre><code>RegExMatch(Content, &quot;O)(?&lt;=&quot;&quot;)[A-Z](?!:\\)[^&quot;&quot;\\]*&quot;, m, m ? m.Pos + m.Len : 1)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-02-10T14:51:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156716#p156716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156715#p156715" />
			<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-02-10T14:49:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156715#p156715</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156714#p156714" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> да, только одной строкой и каждая в двойных кавычках: &quot;Any dir&quot; &quot;AppData&quot; и т.д..</p>]]></content>
			<author>
				<name><![CDATA[humanoid]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43005</uri>
			</author>
			<updated>2023-02-10T14:49:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156714#p156714</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156713#p156713" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Content = &quot;Any dir&quot; &quot;AppData\Local&quot; &quot;AppData\Roaming&quot; &quot;D:\Programs\Notepad++&quot;
List := {}, m := &quot;&quot;
while RegExMatch(Content, &quot;O)(?&lt;=&quot;&quot;)(?![A-Z]:)[A-Z][^&quot;&quot;\\]*&quot;, m, m ? m.Pos + m.Len : 1)
   List[m[0]] := &quot;&quot;
str := &quot;&quot;
for k in List
   str .= (str = &quot;&quot; ? &quot;&quot; : &quot; &quot;) . &quot;&quot;&quot;&quot; . k . &quot;&quot;&quot;&quot;
MsgBox, % str</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-02-10T14:45:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156713#p156713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156712#p156712" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> есть список в одной строке, содержащий path, как в последнем примере. Из него надо исключить все части в кавычках, содержащие &quot;C:\*&quot; &quot;D:\*&quot; и подобные. Затем, если есть, получить корневые директории из оставшихся, содержащие бэкслеш - типа из &quot;AppData\Roaming&quot; получить &quot;AppData&quot;, но могут быть и другие. Удалить дубликаты, если будут встречаться два и более раз &quot;AppData&quot; и подобные. И оставшееся вернуть в виде списка корневых директорый (в названии могут быть пробелы) &quot;Dir name 1&quot; &quot;Dir name 2&quot; &quot;AppData&quot; и т.д. ... Сложно все )))<br />Вообще это директории в 7z архиве, но т.к. нет возможности заглянуть в него без распаковки с помощью AHK, чтобы получить нужные папки для дальнейшей распаковки, использую список с относительными и конкретными путями, который использовался для его упаковки. Если запустить последний пример, будет наглядно видно, что должно получиться...</p>]]></content>
			<author>
				<name><![CDATA[humanoid]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43005</uri>
			</author>
			<updated>2023-02-10T14:32:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156712#p156712</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156711#p156711" />
			<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-02-10T13:19:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156711#p156711</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156710#p156710" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> у меня слишком заморочисто получилось. Не знаю, пригодится ли кому ...</p><div class="codebox"><pre><code>
Content := &quot;&quot;&quot;Any dir&quot;&quot; &quot;&quot;AppData\Local&quot;&quot; &quot;&quot;AppData\Roaming&quot;&quot; &quot;&quot;D:\Programs\Notepad++&quot;&quot;&quot;

For i, str in StrSplit(Content, chr(34) Chr(32) chr(34))
	If (!RegExMatch(str, &quot;i)^\x22?[a-z]:\\.+&quot;)){ ; исключить из поиска строки типа &quot;D:\Programs\Notepad++&quot;
		a := RegExReplace(str, &quot;\x22&quot;, &quot;&quot;) ; удалить оставшиеся &quot;
		b := StrSplit(a, &quot;\&quot;).1 ; разделить полученное по &quot;\&quot; и получить первую часть подстроки
		out .= &quot;&quot;&quot;&quot; b &quot;&quot;&quot; &quot; ; формируем выходной список с двойными кавычками и пробелами
		}
		
For i, str in StrSplit(out , Chr(32)), uniques := {}, D := &quot;&quot; ; удалить дубликаты из полученного списка
	If (!uniques.HasKey(str)){
		D .= str Chr(32), uniques[str] := true
		}
		
out := RTrim(D, Chr(32)) ; удалить из списка все пробелы справа
MsgBox % out
</code></pre></div><p>Может есть пути проще, чтобы все ЭТО изваять?</p>]]></content>
			<author>
				<name><![CDATA[humanoid]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43005</uri>
			</author>
			<updated>2023-02-10T11:15:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156710#p156710</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156709#p156709" />
			<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-02-10T10:22:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156709#p156709</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156708#p156708" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> спасибо за подсказку. Уже сам понял и все сделал.</p>]]></content>
			<author>
				<name><![CDATA[humanoid]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43005</uri>
			</author>
			<updated>2023-02-10T08:28:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156708#p156708</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Разделение строки на части без удаления делимитеров]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=156707#p156707" />
			<content type="html"><![CDATA[<p>В цикле через RegExMatch().</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-02-10T04:44:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=156707#p156707</id>
		</entry>
</feed>
