<?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=13637&amp;type=atom" />
	<updated>2018-04-20T13:36:30Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13637</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124826#p124826" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>sememix пишет:</cite><blockquote><p>сами значения attachments и copy_histori надо оставить на своём месте.</p></blockquote></div><div class="quotebox"><cite>sememix пишет:</cite><blockquote><p><strong>teadrinker</strong>, вот пример возврата - <a href="http://rgho.st/private/6s4YdLwV2/405d7d3004a2f6496c64a72858608aee">http://rgho.st/private/6s4YdLwV2/405d7d … 2858608aee</a></p></blockquote></div><p>У меня так работает:<br /></p><div class="codebox"><pre><code>FileRead, text, D:\Downloads\123.txt
newText := RegExReplace(text, &quot;x)&quot;&quot;(attachments|copy_history)&quot;&quot;:\K(\[ (?: [^\[\]]++ | (?-1) )* \])&quot;)
FileAppend, % newText, %A_Desktop%\123.txt</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-20T13:36:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124826#p124826</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124819#p124819" />
			<content type="html"><![CDATA[<p><strong>sememix</strong>, у вас после &quot;attachments&quot; идет &quot;post_source&quot;.<br />От него и пляшите.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-04-20T10:09:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124819#p124819</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124818#p124818" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, вот пример возврата - <a href="http://rgho.st/private/6s4YdLwV2/405d7d3004a2f6496c64a72858608aee">http://rgho.st/private/6s4YdLwV2/405d7d … 2858608aee</a></p>]]></content>
			<author>
				<name><![CDATA[sememix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33892</uri>
			</author>
			<updated>2018-04-20T09:38:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124818#p124818</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124817#p124817" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, проверил, вообще не работает, оно удаляет абсолютно всё, при работе с огромным текстом и сами значения attachments и copy_histori надо оставить на своём месте.<br />P. S. ответ JSON приходит в одну строку без пробелов.</p>]]></content>
			<author>
				<name><![CDATA[sememix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33892</uri>
			</author>
			<updated>2018-04-20T09:26:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124817#p124817</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124809#p124809" />
			<content type="html"><![CDATA[<p>Или так:<br /></p><div class="codebox"><pre><code>text = {&quot;key&quot;:value,&quot;attachments&quot;:[{key: value, key2:[1, 2, 3]}, {key: value, key2:[1, 2, 3]}],&quot;array&quot;:[1,2,3,4],&quot;copy_history&quot;:[{key: value, key2:[1, 2]}, {key: value, key2:[1, 2]}]}
MsgBox, % RegExReplace(text, &quot;x)&quot;&quot;(?:attachments|copy_history)&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-04-19T19:23:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124809#p124809</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124808#p124808" />
			<content type="html"><![CDATA[<p>Пример:<br /></p><div class="codebox"><pre><code>text = {&quot;key&quot;:value,&quot;attachments&quot;:[{key: value, key2:[1, 2, 3]}, {key: value, key2:[1, 2, 3]}],&quot;array&quot;:[1,2,3,4],&quot;copy_history&quot;:[{key: value, key2:[1, 2]}, {key: value, key2:[1, 2]}]}

RegExMatch(text, &quot;x)&quot;&quot;attachments&quot;&quot;:( \[ (?: [^\[\]]++ | (?-1) )* \] )&quot;, match)
MsgBox, % match1

RegExMatch(text, &quot;x)&quot;&quot;copy_history&quot;&quot;:( \[ (?: [^\[\]]++ | (?-1) )* \] )&quot;, match)
MsgBox, % match1</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-19T19:14:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124808#p124808</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124806#p124806" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, все. Их содержимое надо удалить. Ибо они сильно мешают при дальнейшей обработке.</p>]]></content>
			<author>
				<name><![CDATA[sememix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33892</uri>
			</author>
			<updated>2018-04-19T18:42:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124806#p124806</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124805#p124805" />
			<content type="html"><![CDATA[<p>Так там много ключей attachments, какой из них нужно обрабатывать?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-19T18:35:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124805#p124805</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124804#p124804" />
			<content type="html"><![CDATA[<p>Суть в том, чтобы это можно было на любой странице, ибо всегда ответ разный. Т. е. от&quot;attachments: [&quot;, до своей &quot;]&quot;. Это возможно сделать, но у меня трудности возникли в том, что там внутри несколько скобочек типа &quot;[&quot; &quot;]&quot;.</p>]]></content>
			<author>
				<name><![CDATA[sememix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33892</uri>
			</author>
			<updated>2018-04-19T18:32:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124804#p124804</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124803#p124803" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>sememix пишет:</cite><blockquote><p>Мне нужно вырезать всё содержимое, которое внутри пунктов &quot;attachments&quot; и &quot;copy_history&quot;.</p></blockquote></div><p>Там их много, нужно все обрабатывать?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-19T18:15:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124803#p124803</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124802#p124802" />
			<content type="html"><![CDATA[<p>У меня нету GroupID и token, я разработкой под VK не занимаюсь.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-19T17:59:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124802#p124802</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124801#p124801" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, </p><div class="codebox"><pre><code>https://api.vk.com/method/wall.get?owner_id= %GroupID% &amp;count=100&amp;filter=owner&amp;extended=1&amp;access_token= %token% &amp;v=5.74</code></pre></div>]]></content>
			<author>
				<name><![CDATA[sememix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33892</uri>
			</author>
			<updated>2018-04-19T17:56:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124801#p124801</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124800#p124800" />
			<content type="html"><![CDATA[<p>Ваша ссылка у меня возвращает html-код страницы, вот <a href="https://vk.com/dev/wall.get">этой</a>. Напишите, как посылаете запрос, чтоб получить JSON, либо просто приведите сам JSON.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-04-19T17:55:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124800#p124800</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Вырезка лишнего текста при помощи регулярных выражений.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=124797#p124797" />
			<content type="html"><![CDATA[<p>Делаю запрос к вк и получаю ответ JSON формата. Пример - https://vk.com/dev/wall.get?params[owner_id]=-134831881&amp;params[count]=100&amp;params[filter]=owner&amp;params[extended]=0&amp;params[v]=5.74 (копируем руками, форум не воспринимает такие ссылки)<br />Мне нужно вырезать всё содержимое, которое внутри пунктов &quot;attachments&quot; и &quot;copy_history&quot;.<br />У меня выходит полный ужас, как только не пробовал.<br />Кому не сложно, покажите или помогите это осуществить.</p>]]></content>
			<author>
				<name><![CDATA[sememix]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33892</uri>
			</author>
			<updated>2018-04-18T20:55:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=124797#p124797</id>
		</entry>
</feed>
