<?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=10507&amp;type=atom" />
	<updated>2015-03-20T05:39:53Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10507</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92643#p92643" />
			<content type="html"><![CDATA[<p>А так что бы не строгать табуляцию и регистр тегов никак?</p>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-20T05:39:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92643#p92643</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92641#p92641" />
			<content type="html"><![CDATA[<p>Ну да, оно возвращает код в соответствии с DOM структурой, думаю так меньше шансов &quot;поломать&quot; HTML код.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2015-03-19T20:27:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92641#p92641</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92640#p92640" />
			<content type="html"><![CDATA[<p>Работает, только почему-то удаляет табуляцию и делает заглавными теги в коде.</p>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-19T19:55:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92640#p92640</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92639#p92639" />
			<content type="html"><![CDATA[<p>Может из <a href="http://forum.script-coding.com/viewtopic.php?pid=82640#p82640">этой оперы</a> подойдёт, если тут речь только про HTML.<br /></p><div class="codebox"><pre><code>FileRead, FRead, *P65001 C:\Users\sergey\Desktop\index.html
oHTML := ComObjCreate(&quot;HTMLFile&quot;), oHTML.write(FRead), i := 1
Loop % oHTML.getElementsByTagName(&quot;div&quot;).length
{
    el := oHTML.getElementsByTagName(&quot;div&quot;).item(A_Index-i)
    If (el.getAttribute(&quot;data-type&quot;)) = &quot;email&quot;
        el.parentNode.removeChild(el), i++
}
MsgBox % oHTML.body.InnerHTML</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2015-03-19T19:27:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92639#p92639</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92627#p92627" />
			<content type="html"><![CDATA[<p>Вроде бы работает. Позже когда будет больше файлов попробую более детально.</p>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-19T09:39:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92627#p92627</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92626#p92626" />
			<content type="html"><![CDATA[<p>Странно, почему зацикливается RegexReplace.<br />Попробуй так:<br /></p><div class="codebox"><pre><code>FileRead, FRead, *P65001 %A_Desktop%\index.html
pos := 1
while pos := regexmatch(FRead, &quot;ms)&lt;div class(.(?!&lt;div))*?data-type=&quot;&quot;email&quot;&quot;.*?&lt;/div&gt;\s*&quot;, found, pos)
   FRead := RegExReplace(FRead, found,,,1, pos)
MsgBox % FRead</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-03-19T09:32:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92626#p92626</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92621#p92621" />
			<content type="html"><![CDATA[<p>Вот&nbsp; проверил с другими файлами и опять не работает никаким способом из приведенных выше.</p>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-19T08:02:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92621#p92621</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92615#p92615" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Неработает,</p></blockquote></div><p>У меня с твоим примером работает.<br /></p><div class="quotebox"><blockquote><p>А какой вариант лучше использовать что бы точно работало?</p></blockquote></div><p>Да в принципе, что один, что второй... Разницы не вижу.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-03-18T23:42:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92615#p92615</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92613#p92613" />
			<content type="html"><![CDATA[<p>Неработает, а если также добавить после +?, тогда работает:<br /></p><div class="codebox"><pre><code>FRead := RegExReplace(FRead, &quot;ms)&lt;div class(.(?!&lt;div))+?(data-type=&quot;&quot;email&quot;&quot;).*?&lt;/div&gt;\s*&quot;)</code></pre></div><p>А какой вариант лучше использовать что бы точно работало?</p>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-18T23:28:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92613#p92613</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92612#p92612" />
			<content type="html"><![CDATA[<p>Подобная ошибка описана в справке:<br /><a href="http://www.script-coding.com/AutoHotkey/RegExReplace.html">http://www.script-coding.com/AutoHotkey … place.html</a><br /></p><div class="quotebox"><blockquote><p>ErrorLevel</p><p>Принимает одно из следующих значений:</p><p>&nbsp; &nbsp; 0, т.е. отсутствие ошибок.<br />&nbsp; &nbsp; Строка следующего вида: Compile error N at offset M: описание. В этой строке N будет номером ошибки PCRE, M — позицией ошибочного символа внутри регулярного выражения, затем следует текст, описывающий ошибку.<br />&nbsp; &nbsp; Отрицательное число, что означает, что произошла ошибка во время выполнения регулярного выражения. Хотя такие ошибки редки, с наибольшей вероятностью могут произойти следующие из них: &quot;too many possible empty-string matches&quot; (-22) (слишком много возможных совпадений с пустой строкой), &quot;recursion too deep&quot; (-21) (слишком глубокая рекурсия), &quot;reached match limit&quot; (-8) (достигнут лимит совпадений). Если они происходят, попробуйте перестроить регулярное выражение, чтобы сделать его более избирательным, например, заменив * на ?, + или на диапазон наподобие {0,3} везде, где это возможно.</p></blockquote></div><p>Например, так с твоим примером тоже работает:<br /></p><div class="codebox"><pre><code>FRead := RegExReplace(FRead, &quot;ms)&lt;div class(.(?!&lt;div))+(data-type=&quot;&quot;email&quot;&quot;).*?&lt;/div&gt;\s*&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-03-18T23:15:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92612#p92612</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92611#p92611" />
			<content type="html"><![CDATA[<p>Вроде бы работает. Но уже в который раз по удалял вручную.<br />Позже протестирую применение где файл с множеством блоков.</p>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-18T22:42:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92611#p92611</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92610#p92610" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>FRead := RegExReplace(FRead, &quot;ms)&lt;div class(.(?!&lt;div))*?(data-type=&quot;&quot;email&quot;&quot;).*?&lt;/div&gt;\s*&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-03-18T22:34:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92610#p92610</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92609#p92609" />
			<content type="html"><![CDATA[<p>Не понимаю, те же аналогичные текстовые блоки в этом файле но не удаляются...<br />Наверное придется постоянно вручную удалять, что ли.<br /></p><div class="codebox"><pre><code>FileRead, FRead, *P65001 %A_Desktop%\index.html
FRead := RegExReplace(FRead, &quot;ms)&lt;div class(.(?!&lt;div))*(data-type=&quot;&quot;email&quot;&quot;).*?&lt;/div&gt;\s*&quot;)
MsgBox %FRead%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-18T22:04:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92609#p92609</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92606#p92606" />
			<content type="html"><![CDATA[<p>Что то я не заметил что оно там включено.<br />Вроде теперь работает как надо.<br />Благодарю.</p>]]></content>
			<author>
				<name><![CDATA[avens]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24487</uri>
			</author>
			<updated>2015-03-18T21:16:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92606#p92606</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Удалить текстовый блок по ключевому слову]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92605#p92605" />
			<content type="html"><![CDATA[<p>А зачем жадность включил в конце?<br />Попробуй так:<br /></p><div class="codebox"><pre><code>FRead := RegExReplace(FRead, &quot;ms)&lt;div class(.(?!&lt;div))*(data-type=&quot;&quot;email&quot;&quot;).*?&lt;/div&gt;\s*&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-03-18T21:08:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92605#p92605</id>
		</entry>
</feed>
