<?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=13825&amp;type=atom" />
	<updated>2018-06-08T14:45:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13825</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125896#p125896" />
			<content type="html"><![CDATA[<p>Или так:<br /></p><div class="codebox"><pre><code>cmt_pages=
(
&quot;id&quot;: &quot;1&quot;,
&quot;id&quot;: &quot;2&quot;,
&quot;id&quot;: &quot;3&quot;,
&quot;id&quot;: &quot;4&quot;,
&quot;id&quot;: &quot;5&quot;,
&quot;id&quot;: &quot;6&quot;,
)
arr := StrSplit(cmt_pages, &quot;`n&quot;, &quot;`r&quot;)
max := arr.MaxIndex()
Loop % max
   MsgBox, % RegExReplace( arr[ max - A_Index + 1 ], &quot;&quot;&quot;id&quot;&quot;:\s&quot;&quot;([^&quot;&quot;]+).*&quot;, &quot;$1&quot; )</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-06-08T14:45:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125896#p125896</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125894#p125894" />
			<content type="html"><![CDATA[<p>Я имел в виду так:<br /></p><div class="codebox"><pre><code>cmt_pages=
(
&quot;id&quot;: &quot;1&quot;,
&quot;id&quot;: &quot;2&quot;,
&quot;id&quot;: &quot;3&quot;,
&quot;id&quot;: &quot;4&quot;,
&quot;id&quot;: &quot;5&quot;,
&quot;id&quot;: &quot;6&quot;,
)
match := &quot;&quot;, Pos := 1
While Pos := RegExMatch(cmt_pages, &quot;s)(.+?)(\R|$)&quot;,match,Pos+StrLen(match))
   a := &quot;`n&quot; match1 a

match := &quot;&quot;, Pos := 1
While Pos := RegExMatch(a, &quot;s)&quot;&quot;id&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,&quot;,match,Pos+StrLen(match))
MsgBox % match1</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-08T12:22:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125894#p125894</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125892#p125892" />
			<content type="html"><![CDATA[<p>В 10 посте код выводит весь список, а мне нужен его перебор, для возможности обработки каждого комментария.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-06-08T10:24:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125892#p125892</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125890#p125890" />
			<content type="html"><![CDATA[<p>Так а в чём проблема?<br />Чем вас не устраивает вариант из 10 поста?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-08T07:41:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125890#p125890</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125889#p125889" />
			<content type="html"><![CDATA[<p>Да.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-06-08T07:22:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125889#p125889</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125887#p125887" />
			<content type="html"><![CDATA[<p>То есть у вас такая структура:<br /></p><div class="codebox"><pre><code>kommentarij1
	2
	1
kommentarij2
	3
	2
	1</code></pre></div><p>А вы хотите получить такую?<br /></p><div class="codebox"><pre><code>kommentarij1
	1
	2
kommentarij2
	1
	2
	3</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-08T00:00:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125887#p125887</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125886#p125886" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>А зачем?</p></blockquote></div><p>По умолчанию вложенные комментарии в выдаче API Ютуба располагаются от старых — к новым, и поэтому их надо обратить. То есть, под-ответы к основному комментарию приходят в обратном порядке.<br />С InsertAt и массивом что-то не заладилось, мне бы пример)). Правильно ли понимаю, что перебирать для этой цели придётся дважды и сходу перебирать с конца не получится?</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-06-07T23:37:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125886#p125886</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125885#p125885" />
			<content type="html"><![CDATA[<p>А зачем?Если вы хотите получить обратный порядок совпадений, то, как я уже писал:<br /></p><div class="codebox"><pre><code>cmt_pages=
(
&quot;id&quot;: &quot;1&quot;,
&quot;id&quot;: &quot;2&quot;,
&quot;id&quot;: &quot;3&quot;,
&quot;id&quot;: &quot;4&quot;,
&quot;id&quot;: &quot;5&quot;,
&quot;id&quot;: &quot;6&quot;,
)
match := &quot;&quot;, Pos := 1
While Pos := RegExMatch(cmt_pages, &quot;s)&quot;&quot;id&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,&quot;,match,Pos+StrLen(match))
   a := match1 a
msgbox % a</code></pre></div><p>Если же вам необходимо именно перебирать в обратном порядке, то записывайте совпадения в массив с помощью InsertAt и потом перебирайте его.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-07T22:57:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125885#p125885</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125884#p125884" />
			<content type="html"><![CDATA[<p>Так, вроде:<br /></p><div class="codebox"><pre><code>cmt_pages=
(
&quot;id&quot;: &quot;1&quot;,
&quot;id&quot;: &quot;2&quot;,
&quot;id&quot;: &quot;3&quot;,
&quot;id&quot;: &quot;4&quot;,
&quot;id&quot;: &quot;5&quot;,
&quot;id&quot;: &quot;6&quot;,
)
match := &quot;&quot;, Pos := 1
While Pos := RegExMatch(cmt_pages, &quot;s)&quot;&quot;id&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,&quot;,match,Pos+StrLen(match))
MsgBox % match1</code></pre></div><p>Мне надо начать перебор с конца списка.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-06-07T22:34:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125884#p125884</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125883#p125883" />
			<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>2018-06-07T21:13:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125883#p125883</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125882#p125882" />
			<content type="html"><![CDATA[<p>Имелся в виду while в таком формате, где не понятно, где указывать «<strong>!=</strong>»:<br /></p><div class="codebox"><pre><code>match := &quot;&quot;, Pos := 1
While Pos := RegExMatch(cmt_pages, &quot;s)&quot;&quot;id&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorDisplayName&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorProfileImageUrl&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorChannelUrl&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;textOriginal&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;likeCount&quot;&quot;: (\d+),\R.+?&quot;&quot;publishedAt&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;totalReplyCount&quot;&quot;: (\d+),\R&quot;,match,Pos+StrLen(match))</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-06-07T21:11:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125882#p125882</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125881#p125881" />
			<content type="html"><![CDATA[<p>А разница какая между while или loop?<br /></p><div class="codebox"><pre><code>while A_Index != 10
   a := &quot;`n&quot; A_Index a
msgbox % a</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-07T20:39:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125881#p125881</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125880#p125880" />
			<content type="html"><![CDATA[<p>К сожалению, намёк не понял)). Применительно к While как это можно записать?</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-06-07T19:59:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125880#p125880</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125859#p125859" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>loop
   msgbox % a := A_Index a</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-06-07T01:24:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125859#p125859</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор в обратном порядке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=125858#p125858" />
			<content type="html"><![CDATA[<p>Там следующая конструкция (часть кода, скачивающего комментарии с Ютуба):</p><div class="codebox"><pre><code>
match := &quot;&quot;, Pos := 1
While Pos := RegExMatch(cmt_pages, &quot;s)&quot;&quot;id&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorDisplayName&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorProfileImageUrl&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorChannelUrl&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;textOriginal&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;likeCount&quot;&quot;: (\d+),\R.+?&quot;&quot;publishedAt&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;totalReplyCount&quot;&quot;: (\d+),\R&quot;,match,Pos+StrLen(match))
{
   y_cmts := match2 &quot;`n&quot; match3 &quot;`n&quot; match4 &quot;`n&quot; match5 &quot;`n&quot; match6 &quot;`n&quot; match7 &quot;`n&quot; match8

   If (match8 &gt; 0)
   {
      sleep, 400
      ResponseText =
      parentId := match1
      Api_Url_parentId = %apis_cmtParent%%parentId%&amp;key=%key%%other_parentId%

      HTTP.Open(&quot;GET&quot;, Api_Url_parentId, true)
   ;   HTTP.SetRequestHeader(&quot;Cookie&quot;, &quot;remixlang=0&quot;)   ; имена на русском
      HTTP.SetRequestHeader(&quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;)
      HTTP.SetRequestHeader(&quot;User-Agent&quot;, &quot;Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko)&quot;)
      HTTP.SetRequestHeader(&quot;Pragma&quot;, &quot;no-cache&quot;)
      HTTP.SetRequestHeader(&quot;Cache-Control&quot;, &quot;no-cache, no-store&quot;)
      HTTP.SetRequestHeader(&quot;If-Modified-Since&quot;, &quot;Sat, 1 Jan 2000 00:00:00 GMT&quot;)
      HTTP.Send()
      HTTP.WaitForResponse()
      ResponseText := HTTP.ResponseText

      matchh := &quot;&quot;, Poss := 1
      While Poss := RegExmatch(ResponseText, &quot;s)&quot;&quot;id&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorDisplayName&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorProfileImageUrl&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;authorChannelUrl&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;textOriginal&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R.+?&quot;&quot;likeCount&quot;&quot;: (\d+),\R.+?&quot;&quot;publishedAt&quot;&quot;: &quot;&quot;(.+?)&quot;&quot;,\R&quot;,matchh,Poss+StrLen(matchh))
      {
         y_sub_cmts .= &quot;`n&lt;UL&gt;`n&quot; matchh2 &quot;`n&quot; matchh3 &quot;`n&quot; matchh4 &quot;`n&quot; matchh5 &quot;`n&quot; matchh6 &quot;`n&quot; matchh7 &quot;`n&quot; matchh8 &quot;`n&lt;UL&gt;`n&quot;
      }

   GoSub, RedTransDelim
   }
   Else
      GoSub, RedTransDelim
}
</code></pre></div><p>Как быть в этом случае?</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-06-07T00:21:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=125858#p125858</id>
		</entry>
</feed>
