<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Поиск всех вложений regExMatch]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16896&amp;type=atom" />
	<updated>2022-01-23T07:52:44Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16896</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151767#p151767" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Phoenixxx_Czar пишет:</cite><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>2022-01-23T07:52:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151767#p151767</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151765#p151765" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>Использовать цикл &#039;For&#039; куда удобнее и красивее, меньше строк выходит и никаких функций не нужно придумывать.</p></blockquote></div><div class="codebox"><pre><code>For i, val in Match := StrSplit(str, &quot; &quot;, &quot;.&quot;)
    MsgBox, % val</code></pre></div><p>Куда удобнее будет, чем &#039;Match[ i]&#039;.</p><p><strong>Malcev</strong>, думаю все же добавить возможность добавлять свои параметры - проще.<br /></p><div class="codebox"><pre><code>regExMatchAll(haystack, needleRegEx, options := &quot;&quot;)
{
	out := []

	while RegExMatch(haystack, options &quot;O)&quot; needleRegEx, match, match ? match.Pos + match.Len : 1)
	{
		out.push(match)
	}

	return out
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2022-01-22T22:46:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151765#p151765</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151736#p151736" />
			<content type="html"><![CDATA[<p><strong>Phoenixxx_Czar</strong>, советую вставить &quot;s&quot; в опции.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2022-01-22T14:27:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151736#p151736</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151733#p151733" />
			<content type="html"><![CDATA[<p><strong>Phoenixxx_Czar</strong></p><p>Использовать цикл &#039;For&#039; куда удобнее и красивее, меньше строк выходит и никаких функций не нужно придумывать.<br />Про какие группы идёт речь? Запятую тоже можно игнорить если что. RegEx работает дольше обычных команд, так что думаю его лучше использовать в сложных задачах.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2022-01-22T14:16:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151733#p151733</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151720#p151720" />
			<content type="html"><![CDATA[<p>А про какие недочеты тогда говориться, если скрипт работает.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2022-01-22T10:33:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151720#p151720</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151716#p151716" />
			<content type="html"><![CDATA[<p>В данном примере использовалась регулярка на вхождение английских символов, одинарная кавычка и тире.</p>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2022-01-22T10:14:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151716#p151716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151713#p151713" />
			<content type="html"><![CDATA[<p>Я вижу недочет, что не сохраняются русские символы. Насколько знаю, в regExMatchAll за это отвечает: *UCP. А так, ничего особенного.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2022-01-22T09:13:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151713#p151713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151712#p151712" />
			<content type="html"><![CDATA[<p>Боже.. Это обычный пример, где обычный regExMatch не захватит все группы. Конечно можно сделать и как у вас, но нужно учесть, что есть еще запятые, да ведь? И в чем прикол использование for в таком виде?</p>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2022-01-22T06:41:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151712#p151712</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151710#p151710" />
			<content type="html"><![CDATA[<p>Не совсем понял сути функции. Если задача разделить по словам, можно обойтись более простым способом:</p><div class="codebox"><pre><code>For i in Match := StrSplit(str, &quot; &quot;, &quot;.&quot;)
 MsgBox, % Match[i]</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2022-01-21T23:07:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151710#p151710</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151702#p151702" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Phoenixxx_Czar пишет:</cite><blockquote><p>недочеты в ней</p></blockquote></div><p>Может понадобиться изменить опции в RegEx, здесь такой возможности нет. Я бы сразу использовал <em>while RegExMatch ...</em> без всякой функции.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-01-21T11:16:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151702#p151702</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Поиск всех вложений regExMatch]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=151696#p151696" />
			<content type="html"><![CDATA[<p>Иногда появлялась необходимость найти все вложения в строке по шаблону, натыкался на код, который это делает, но я его вечно терял, а вспоминать суть работы с нуля как-то лень что-ли. Хотел бы поделиться функцией, но интересны недочеты в ней.</p><div class="codebox"><pre><code>regExMatchAll(haystack, needleRegEx, options := &quot;&quot;)
{
	out := []

	while RegExMatch(haystack, options &quot;O)&quot; needleRegEx, match, match ? match.Pos + match.Len : 1)
	{
		out.push(match)
	}

	return out
}
</code></pre></div><p>Не знаю какой пример применения с ходу можно придумать, но допустим мы хотим получить все <strong>английские</strong> слова из строки:</p><div class="codebox"><pre><code>str := &quot;I want to grow. I want to be better. You grow. We all grow. We&#039;re made to grow. You either evolve or you disappear.&quot; ; (C) Tupac Amaru Shakur

for i, match in regExMatchAll(str, &quot;[A-Za-z\&#039;\-]+&quot;)
{
	msgbox, % match[0]
}

regExMatchAll(haystack, needleRegEx, options := &quot;&quot;)
{
	out := []

	while RegExMatch(haystack, options &quot;O)&quot; needleRegEx, match, match ? match.Pos + match.Len : 1)
	{
		out.push(match)
	}

	return out
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2022-01-21T01:38:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=151696#p151696</id>
		</entry>
</feed>
