<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Нумерация в цикле]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=14667</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=14667&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Нумерация в цикле».]]></description>
		<lastBuildDate>Fri, 01 May 2020 09:18:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=139263#p139263</link>
			<description><![CDATA[<div class="codebox"><pre><code>
fbody =
(
	&lt;h2&gt;La crisis &lt;/h2&gt;

		&lt;p&gt;de&amp;nbsp;Europa&lt;/p&gt;
	&lt;div class=&quot;entry&quot;&gt;
)
Pos = 1
 
while RegExMatch(fbody, &quot;iO)(&lt;(p|h\d+|li)&gt;.*?&lt;/.*?&gt;)&quot;, mm, Pos), Pos := mm.Pos + mm.Len
{
   n := Format(&quot;§{:010}§&quot;, a_index) 
   fbody := RegExReplace(fbody, mm[0], n . mm[0] . n,, 1, mm.Pos)
}
msgbox % fbody
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 01 May 2020 09:18:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=139263#p139263</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=139254#p139254</link>
			<description><![CDATA[<p>То есть, хотелось бы определить, где конец строки.</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Thu, 30 Apr 2020 18:39:47 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=139254#p139254</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=139250#p139250</link>
			<description><![CDATA[<div class="codebox"><pre><code>fbody =
(
	&lt;h2&gt;La crisis &lt;/h2&gt;

		&lt;p&gt;de&amp;nbsp;Europa&lt;/p&gt;
	&lt;div class=&quot;entry&quot;&gt;
)
mm := &quot;&quot;, Pos = 1
while RegExMatch(fbody, &quot;iO)(&lt;p|&lt;h1|&lt;h2|&lt;h3|&lt;h4|&lt;h5|&lt;h6|&lt;li)\b&quot;, mm, mm ? mm.Pos + mm.Len + 14 : 1)
{
   n := Format(&quot;§{:010}§&quot;, a_index)
   fbody := RegExReplace(fbody, mm[0], n . mm[0],, 1, mm.Pos)
}
msgbox % fbody</code></pre></div><p>Куда следует добавить «n», чтобы строка обрамлялась одинаковым числом, с таким результатом? —<br /></p><div class="codebox"><pre><code>
	§0000000001§&lt;h2&gt;La crisis &lt;/h2&gt;§0000000001§

		§0000000002§&lt;p&gt;de&amp;nbsp;Europa&lt;/p&gt;§0000000002§
	&lt;div class=&quot;entry&quot;&gt;
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Thu, 30 Apr 2020 17:05:45 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=139250#p139250</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=139247#p139247</link>
			<description><![CDATA[<p>Проще так, если я понял правильно:<br /></p><div class="codebox"><pre><code>html =
(
&lt;p&gt; &lt;img data-attachment-id=&quot;11522&quot; data-permalink=&quot;https://paginatransversal.wordpress.com/2017/06/26/tiene-el-cristianismo-un-futuro/cristianismo/&quot; data-orig-file=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg&quot; data-orig-size=&quot;1024,576&quot; data-comments-opened=&quot;1&quot; data-image-meta=&quot;{&amp;quot;aperture&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;credit&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;camera&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;caption&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;created_timestamp&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;copyright&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;focal_length&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;iso&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;shutter_speed&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;title&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;orientation&amp;quot;:&amp;quot;0&amp;quot;}&quot; data-image-title=&quot;CRISTIANISMO&quot; data-image-description=&quot;&quot; data-medium-file=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=300&quot; data-large-file=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=1024&quot; class=&quot; wp-image-11522 alignleft&quot; src=&quot;pic/2017=06=cristianismo.jpg_w=187_038_h=105.jpg&quot; alt=&quot;&quot; width=&quot;187&quot; height=&quot;105&quot; srcset=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=187&amp;amp;h=105 187w, https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=374&amp;amp;h=210 374w, https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=150&amp;amp;h=84 150w, https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=300&amp;amp;h=169 300w&quot; sizes=&quot;(max-width: 187px) 100vw, 187px&quot; /&gt;por &lt;strong&gt;Vladimir Legoyda&lt;/strong&gt; &amp;#8211; ВїTiene el cristianismo un futuro? El pensador polaco del siglo XX Kolokovsky dijo una vez con mucha exactitud que la lucha contra el cristianismo no se lleva a cabo a travГ©s de la discusiГіn. El arma principal es un cacareo insensato. No los argumentos de los oponentes, no un sistema de pruebas, no las reflexiones filosГіficas&amp;#8230; sino una negaciГіn del diГЎlogo y una risa sin sentido.&lt;span id=&quot;more-11521&quot;&gt;&lt;/span&gt;&lt;/p&gt;
)

while RegExMatch(html, &quot;OU)(.*)(&lt;.+&gt;)&quot;, m, m ? m.Pos + m.Len : 1)
   newHtml .= m[1] . Format(&quot;[{:010}]&quot;, A_Index) . m[2]
MsgBox, % newHtml</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 30 Apr 2020 08:23:02 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=139247#p139247</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=139246#p139246</link>
			<description><![CDATA[<p>Как я понял, это количество символов в строке из предыдущего задания, но замена на большее число не работала. Возможна ли работа без привязки к длине строки?</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Thu, 30 Apr 2020 06:56:28 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=139246#p139246</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=139243#p139243</link>
			<description><![CDATA[<p>А откуда число 14 взялось?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 29 Apr 2020 23:27:52 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=139243#p139243</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=139242#p139242</link>
			<description><![CDATA[<p>По какой причине номер не проставляется перед всеми тегами, как это предполагается в рег. выражении? — <br /></p><div class="codebox"><pre><code>
html =
(
&lt;p&gt; &lt;img data-attachment-id=&quot;11522&quot; data-permalink=&quot;https://paginatransversal.wordpress.com/2017/06/26/tiene-el-cristianismo-un-futuro/cristianismo/&quot; data-orig-file=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg&quot; data-orig-size=&quot;1024,576&quot; data-comments-opened=&quot;1&quot; data-image-meta=&quot;{&amp;quot;aperture&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;credit&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;camera&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;caption&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;created_timestamp&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;copyright&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;focal_length&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;iso&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;shutter_speed&amp;quot;:&amp;quot;0&amp;quot;,&amp;quot;title&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;orientation&amp;quot;:&amp;quot;0&amp;quot;}&quot; data-image-title=&quot;CRISTIANISMO&quot; data-image-description=&quot;&quot; data-medium-file=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=300&quot; data-large-file=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=1024&quot; class=&quot; wp-image-11522 alignleft&quot; src=&quot;pic/2017=06=cristianismo.jpg_w=187_038_h=105.jpg&quot; alt=&quot;&quot; width=&quot;187&quot; height=&quot;105&quot; srcset=&quot;https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=187&amp;amp;h=105 187w, https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=374&amp;amp;h=210 374w, https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=150&amp;amp;h=84 150w, https://paginatransversal.files.wordpress.com/2017/06/cristianismo.jpg?w=300&amp;amp;h=169 300w&quot; sizes=&quot;(max-width: 187px) 100vw, 187px&quot; /&gt;por &lt;strong&gt;Vladimir Legoyda&lt;/strong&gt; &amp;#8211; ВїTiene el cristianismo un futuro? El pensador polaco del siglo XX Kolokovsky dijo una vez con mucha exactitud que la lucha contra el cristianismo no se lleva a cabo a travГ©s de la discusiГіn. El arma principal es un cacareo insensato. No los argumentos de los oponentes, no un sistema de pruebas, no las reflexiones filosГіficas&amp;#8230; sino una negaciГіn del diГЎlogo y una risa sin sentido.&lt;span id=&quot;more-11521&quot;&gt;&lt;/span&gt;&lt;/p&gt;
)

match := &quot;&quot;, Pos = 1
while RegExMatch(html, &quot;iO)&lt;[^&gt;]*&gt;&quot;, match, match ? match.Pos + match.Len + 14 : 1)
{
   n := Format(&quot;{:0&quot; . 10 . &quot;u}&quot;, a_index)
   html := RegExReplace(html, match[0], &quot;[&quot; . n . &quot;]&quot; . match[0],, 1, match.Pos)
}
msgbox % html</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Wed, 29 Apr 2020 19:54:01 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=139242#p139242</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=133105#p133105</link>
			<description><![CDATA[<div class="codebox"><pre><code>str =
(
&lt;h1 class=&quot;&quot;&gt;
   &lt;h2 class=&quot;&quot;&gt;
      &lt;h3 class=&quot;&quot;&gt;
&lt;h2 id=&quot;1&quot;&gt;
&lt;h2 id=&quot;2&quot;&gt;
)
match := &quot;&quot;
while RegExMatch(str, &quot;iO)&lt;h\d+&quot;, match, match ? match.Pos + match.Len + 14 : 1)
   str := RegExReplace(str, match[0], &quot;&lt;a name=&quot;&quot;&quot; . A_Index . &quot;&quot;&quot;&gt;&lt;/a&gt;&quot; . match[0],, 1, match.Pos)
MsgBox % str </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 24 Mar 2019 17:32:54 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=133105#p133105</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=133104#p133104</link>
			<description><![CDATA[<p>А как сделать, чтобы нумерация не повторялась для одинаковых тегов?<br /></p><div class="codebox"><pre><code>str =
(
&lt;h1 class=&quot;&quot;&gt;
   &lt;h2 class=&quot;&quot;&gt;
      &lt;h3 class=&quot;&quot;&gt;
&lt;h2 id=&quot;1&quot;&gt;
&lt;h2 id=&quot;2&quot;&gt;
)
str := RegExReplace(str, &quot;i)&lt;h(\d+)[^&gt;]*&gt;&quot;, &quot;&lt;a name=&quot;&quot;$1&quot;&quot;&gt;&lt;/a&gt;$0&quot;)
MsgBox % str</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sun, 24 Mar 2019 16:59:42 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=133104#p133104</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=133102#p133102</link>
			<description><![CDATA[<div class="codebox"><pre><code>str =
(
&lt;h1 class=&quot;
   &lt;h2 class=&quot;
      &lt;h3 class=&quot;
)
MsgBox, % RegExReplace(str, &quot;&lt;h(\d+)\s+class=&quot;, &quot;&lt;a name=&quot;&quot;$1&quot;&quot;&gt;&lt;/a&gt;$0&quot;)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 24 Mar 2019 16:35:00 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=133102#p133102</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Нумерация в цикле]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=133101#p133101</link>
			<description><![CDATA[<div class="codebox"><pre><code>str =
(
&lt;h1 class=&quot;
	&lt;h2 class=&quot;
		&lt;h3 class=&quot;
)

RegexReplace(str, &quot;is)(&lt;h1|&lt;h2|&lt;h3|&lt;h4|&lt;h5)&quot;,, headersCount) ;определить колич заголовков
loop, %headersCount%
{
   str := RegExReplace(str, &quot;m`a)(&lt;h1|&lt;h2|&lt;h3|&lt;h4|&lt;h5)&quot;, &quot;&lt;a name=&quot;&quot;&quot; A_Index &quot;&quot;&quot;&gt;&lt;/a&gt;$1&quot;)
}
MsgBox % str</code></pre></div><p>Как произвести разовую обработку в каждой строке, с назначением возрастающей нумерации, чтобы получилось, как ниже? — <br /></p><div class="codebox"><pre><code>
&lt;a name=&quot;1&quot;&gt;&lt;/a&gt;&lt;h1 class=&quot;
	&lt;a name=&quot;2&quot;&gt;&lt;/a&gt;&lt;h2 class=&quot;
		&lt;a name=&quot;3&quot;&gt;&lt;/a&gt;&lt;h3 class=&quot;
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sun, 24 Mar 2019 16:25:04 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=133101#p133101</guid>
		</item>
	</channel>
</rss>
