<?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>https://forum.script-coding.com/viewtopic.php?id=15330</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15330&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Поиск в буфере обмена по нескольким регекспам».]]></description>
		<lastBuildDate>Sat, 02 May 2020 19:56:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139303#p139303</link>
			<description><![CDATA[<p><strong>serzh82saratov</strong><br />Пока писал-отправлял последний пост пришло ваше сообщение. На мониторе в Notepade++ в двух областях экрана были окрыты оба скрипта. Таскал оттуда-сюда регекспы для теста и по-видимому натаскал лишнего.</p>]]></description>
			<author><![CDATA[null@example.com (stokber)]]></author>
			<pubDate>Sat, 02 May 2020 19:56:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139303#p139303</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139300#p139300</link>
			<description><![CDATA[<p>Да уж. Смешались кони, люди… Тысяча извинений. И огромное спасибо за долготерпение и отзывчивость. Всего доброго!<br />Пора, наверное, спать.</p>]]></description>
			<author><![CDATA[null@example.com (stokber)]]></author>
			<pubDate>Sat, 02 May 2020 19:42:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139300#p139300</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139298#p139298</link>
			<description><![CDATA[<p>Так не работало, и решили от себя добавить?<br /></p><div class="codebox"><pre><code>
str := &quot;.1233cdABCD123&quot;
oPatterns := [

	, [&quot;r1_Прописные буквы&quot;, &quot;AB&quot;]
;	, [&quot;r2_строчные буквы&quot;, &quot;cd&quot;, &quot;i&quot;]
;	, [&quot;r3_Точки&quot;, &quot;\.&quot;]
	, [&quot;r4_Числа&quot;, &quot;\d+&quot;]]
 
for k, v in oPatterns 
	patterns .= &quot;((*:&quot; v[1] &quot;)&quot; . (v[3] ? &quot;(?&quot; v[3] &quot;)&quot; : &quot;&quot;) . v[2] &quot;)|&quot;  
	
RegExMatch(str, &quot;O)&quot; RTrim(patterns, &quot;|&quot;), Match)
c := StrSplit(Match.Mark, &quot;_&quot;)

MsgBox, % &quot;шаблон: &quot; c[1] &quot;`nКомментарий: &quot; c[2]  &quot;`nпозиция: &quot; Match.Pos &quot;`nдлинна: &quot; Match.Len &quot;`nстрока: &quot; Match.Value
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 19:33:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139298#p139298</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139296#p139296</link>
			<description><![CDATA[<p>Опять ничего не понял. Ощущение что есть проблемы, но я о них сам должен догадаться.<br />Это откуда?<br /></p><div class="codebox"><pre><code>
	patterns .= &quot;((*:&quot; v[1] &quot;)&quot; . (v[3] ? &quot;(?&quot; v[3] &quot;)&quot; : &quot;&quot;) . v[2] &quot;)|&quot;  
	patterns .= &quot;((*:&quot; k &quot;)&quot; v &quot;)|&quot;
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 19:24:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139296#p139296</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139295#p139295</link>
			<description><![CDATA[<p>Почему-то решил, что это фича такая.<br />Проверил ещё раз. Неправильно указал характер ошибки.&nbsp; При закомментировании одного из регекспов сработало не корректно. В сообщении были только номер шаблона и позиция. Комментарий и строка — пусто. Недостаточно тщательно проверил и наверное сделал неправильные выводы. Причина, кажется, в том, что в моем случае осталось всего два рабочих регекспа:<br /></p><div class="codebox"><pre><code>str := &quot;.1233cdABCD123&quot;
oPatterns := [

	, [&quot;r1_Прописные буквы&quot;, &quot;AB&quot;]
;	, [&quot;r2_строчные буквы&quot;, &quot;cd&quot;, &quot;i&quot;]
;	, [&quot;r3_Точки&quot;, &quot;\.&quot;]
	, [&quot;r4_Числа&quot;, &quot;\d+&quot;]]

for k, v in oPatterns 
	patterns .= &quot;((*:&quot; v[1] &quot;)&quot; . (v[3] ? &quot;(?&quot; v[3] &quot;)&quot; : &quot;&quot;) . v[2] &quot;)|&quot;  
	patterns .= &quot;((*:&quot; k &quot;)&quot; v &quot;)|&quot;
	RegExMatch(str, &quot;O)&quot; RTrim(patterns, &quot;|&quot;), Match)
c := StrSplit(Match.Mark, &quot;_&quot;)
MsgBox, % &quot;шаблон: &quot; c[1] &quot;`nКомментарий: &quot; c[2]  &quot;`nпозиция: &quot; Match.Pos &quot;`nдлинна: &quot; Match.Len &quot;`nстрока: &quot; Match.Value</code></pre></div><p>Каюсь.</p>]]></description>
			<author><![CDATA[null@example.com (stokber)]]></author>
			<pubDate>Sat, 02 May 2020 19:17:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139295#p139295</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139291#p139291</link>
			<description><![CDATA[<p>Скорее последнее.<br />Почему нельзя сразу сказать об этом, и привести скриншот ошибки?<br />Или код который не работает.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 18:40:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139291#p139291</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139290#p139290</link>
			<description><![CDATA[<p>Я попробовал добавить в &quot;Opatterns&quot; из 18-го поста ещё регулярных выражений, скрипт заругался. Очевидно, нужно править ещё и &quot;patterns&quot;. В случае кода из 17-го, скрипт сразу стал искать новые совпадения без каких либо правок в &quot;patterns&quot;. Поэтому я и предпочел код из 17-го. Или я по своей дремучести что-то не понял?</p>]]></description>
			<author><![CDATA[null@example.com (stokber)]]></author>
			<pubDate>Sat, 02 May 2020 18:32:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139290#p139290</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139289#p139289</link>
			<description><![CDATA[<p>Ничего не понял из вашего ответа, но к «А-ЯЁ» вписать по моему проще &quot;i&quot;, чего вы и хотели добиться, а сейчас вдруг перехотели.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 17:49:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139289#p139289</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139288#p139288</link>
			<description><![CDATA[<p><strong>serzh82saratov</strong><br />Ну, я как-то так и подумал. Но надежда теплилась… Для меня предпочтительнее все-же при отладке и наполнении регекспами не править &quot;patterns&quot;и не путаться там при большом количестве регулярок. Проще лишний раз «А-ЯЁ» вписать.&nbsp; Огромное вам спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (stokber)]]></author>
			<pubDate>Sat, 02 May 2020 17:45:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139288#p139288</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139287#p139287</link>
			<description><![CDATA[<p>Так вы зачем из 17 код берёте, если про ключи (Опции) я только в 18 упоминаю.<br /></p><div class="codebox"><pre><code>
oPatterns := [
	, [&quot;r2_Прописные буквы&quot;, &quot;AB&quot;]
	, [&quot;r1_строчные буквы&quot;, &quot;cd&quot;, &quot;i&quot;]
	, [&quot;r3_Числа&quot;, &quot;\d+&quot;]]
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 17:13:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139287#p139287</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139286#p139286</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><div class="codebox"><pre><code>oPatterns := {&quot;r1`nстрочные буквы&quot;: &quot;cd&quot;
			, &quot;r2`nПрописные буквы&quot;:&quot;ab&quot;
			, &quot;r3`nЧисла&quot;: &quot;\d+&quot;}</code></pre></div></blockquote></div><p>Это оно! Теперь можно и задокументировать ставшие ненужными, и добавить новые регекспы без необходимости править &quot;patterns&quot;.<br />Только не смог разобраться как к этому коду приделать ключи.</p>]]></description>
			<author><![CDATA[null@example.com (stokber)]]></author>
			<pubDate>Sat, 02 May 2020 16:13:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139286#p139286</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139284#p139284</link>
			<description><![CDATA[<p>Опции можно добавить в третьем параметре шаблона.<br /></p><div class="codebox"><pre><code>
str := &quot;CDcd1233cdABCD123&quot;

oPatterns := [
	, [&quot;r2_Прописные буквы&quot;, &quot;AB&quot;]
	, [&quot;r1_строчные буквы&quot;, &quot;cd&quot;, &quot;i&quot;]
	, [&quot;r3_Числа&quot;, &quot;\d+&quot;]]

for k, v in oPatterns 
	patterns .= &quot;((*:&quot; v[1] &quot;)&quot; . (v[3] ? &quot;(?&quot; v[3] &quot;)&quot; : &quot;&quot;) . v[2] &quot;)|&quot;  
	
RegExMatch(str, &quot;O)&quot; RTrim(patterns, &quot;|&quot;), Match)
c := StrSplit(Match.Mark, &quot;_&quot;)

MsgBox, % &quot;шаблон: &quot; c[1] &quot;`nКомментарий: &quot; c[2]  &quot;`nпозиция: &quot; Match.Pos &quot;`nдлинна: &quot; Match.Len &quot;`nстрока: &quot; Match.Value
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 13:25:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139284#p139284</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139283#p139283</link>
			<description><![CDATA[<div class="quotebox"><cite>stokber пишет:</cite><blockquote><p>перелицевал вот таким образом</p></blockquote></div><p>Тогда уж так:<br /></p><div class="codebox"><pre><code>
str := &quot;CDcd1233cdABCD123&quot;

oPatterns := {&quot;r1`nстрочные буквы&quot;: &quot;cd&quot;
			, &quot;r2`nПрописные буквы&quot;:&quot;ab&quot;
			, &quot;r3`nЧисла&quot;: &quot;\d+&quot;}

for k, v in oPatterns
	patterns .= &quot;((*:&quot; k &quot;)&quot; v &quot;)|&quot;
	
RegExMatch(str, &quot;O)&quot; RTrim(patterns, &quot;|&quot;), Match)

MsgBox, % &quot;шаблон: &quot; Match.Mark &quot;`nпозиция: &quot; Match.Pos &quot;`nдлинна: &quot; Match.Len &quot;`nстрока: &quot; Match.Value
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 13:12:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139283#p139283</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139281#p139281</link>
			<description><![CDATA[<p>Спасибо! Для себя перелицевал вот таким образом:</p><div class="codebox"><pre><code>str := &quot;CDcd1233cdABCD123&quot;
r1 := &quot;(*:r1#строчные буквы)cd&quot;
r2 := &quot;(*:r2#Прописные буквы)AB&quot;
r3 := &quot;(*:r3#Числа)\d+&quot;
oPatterns := [r1, r2, r3]
for k, v in oPatterns
	patterns .= &quot;(&quot; v &quot;)|&quot;
RegExMatch(str, &quot;O)&quot; RTrim(patterns, &quot;|&quot;), Match)
loop,parse, % Match.Mark, #
	c%A_Index%:=A_LoopField	
MsgBox, % &quot;Шаблон: &quot; c1 &quot;`nКомментарий: &quot; c2 &quot;`nПозиция: &quot; Match.Pos &quot;`nДлина: &quot; Match.Len &quot;`nСтрока: &quot; Match.Value</code></pre></div><p>И два вопроса не дают покоя.<br />1. Хотел исхитриться, хоть и не очень на это и надеялся, отдельным регекспам присвоить ключи регистронезависимости i). Пришел к выводу, что это невозможно. Или всё-таки?<br />2. И в связи с п.1 и не только… Изначально решил пойти путем создания одного большого регулярного выражения с альтернативами. Вопрос: существует ли в AHK возможность сделать шаблоны соответствия более независимыми друг от друга, чтобы они могли иметь свои ключи и пополнялись бы простым добавлением и исключались бы комментированием?</p>]]></description>
			<author><![CDATA[null@example.com (stokber)]]></author>
			<pubDate>Sat, 02 May 2020 13:01:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139281#p139281</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Поиск в буфере обмена по нескольким регекспам]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139245#p139245</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Не знал про Mark. Можно ещё так обернуть, для удобства добавления, и выводить например сам шаблон если нужно. <br /></p><div class="codebox"><pre><code>str := &quot;123abcd&quot;

oPatterns := [&quot;cd&quot;, &quot;ab&quot;, &quot;\d+&quot;]

for k, v in oPatterns
	patterns .= &quot;((*:&quot; v &quot;)&quot; v &quot;)|&quot;
	
RegExMatch(str, &quot;O)&quot; RTrim(patterns, &quot;|&quot;), Match)

MsgBox, % &quot;шаблон: &quot; Match.Mark &quot;`nпозиция: &quot; Match.Pos &quot;`nдлинна: &quot; Match.Len &quot;`nстрока: &quot; Match.Value
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 30 Apr 2020 06:15:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139245#p139245</guid>
		</item>
	</channel>
</rss>
