<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13162&amp;type=atom" />
	<updated>2017-11-04T10:53:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13162</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120755#p120755" />
			<content type="html"><![CDATA[<p>FileReadLine в цикле поможет разбирать файл построчно. A_Index в качестве аргумента, обозначающего номер строки. А если весь файл в переменную завести то FileRead. Насчёт переменны - уверен потому, что переменная всего одна &quot;(.*)&quot;. В RexExMatch в output var помещаются значения тех фрагментов текста, которые обозначены в вашем шаблоне как переменные. Пример:<br /></p><div class="codebox"><pre><code>var := &quot;12345 abcde&quot;
RegExMatch(var, &quot;(.*) (.*)&quot;, end_str)
; end_str1 содержит все что до пробела (первого или последнего это уже вопрос жадности, но в данном случае до первого
; end_str2 содержит все что после пробела
RegExMatch(var, &quot;1(.*)&quot;, end_s)
; end_s1 содержит все что находится после символа 1
; end_s2 пустой, т.к. нет второй переменной в шаблоне, т.е. end_s2 не существует вообще.

; При этом в переменных end_s и end_str содержится все содержимое, которые было найдено в var по указанному вами шаблону, в случае если заданный вами шаблон существует в этой переменной, в противном - переменные пустые.</code></pre></div><p>Возможно в каких-то деталях я мог ошибиться, но принцип я вам обозначил.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-11-04T10:53:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120755#p120755</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120754#p120754" />
			<content type="html"><![CDATA[<p>В общем, задача следующая: преобразовать текстовый файл в переменную с содержанием:<br /></p><div class="codebox"><pre><code>10:05 - 10:50 IT (Пушкин)[A111]
10:05 - 10:50 IT (Грибоедов)[B407]
11:00 - 11:45 IT (Пушкин)[A111]
11:00 - 11:45 IT (Грибоедов)[B407]</code></pre></div><p>либо в несколько переменных с 1 строкой на каждую.</p>]]></content>
			<author>
				<name><![CDATA[Alex_Lexon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32135</uri>
			</author>
			<updated>2017-11-04T09:59:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120754#p120754</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120753#p120753" />
			<content type="html"><![CDATA[<p><strong>belyankin12</strong> хм... Вы уверены?</p>]]></content>
			<author>
				<name><![CDATA[Alex_Lexon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32135</uri>
			</author>
			<updated>2017-11-04T09:54:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120753#p120753</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120751#p120751" />
			<content type="html"><![CDATA[<p>Дык AsdDva2 вообще не существует, потому и пустая. Переменная в шаблоне всего одна.</p>]]></content>
			<author>
				<name><![CDATA[belyankin12]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34408</uri>
			</author>
			<updated>2017-11-04T08:42:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120751#p120751</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120749#p120749" />
			<content type="html"><![CDATA[<p><strong>Phoenixxx_Czar</strong> не знаю как в AHK, но вообще (.*) это регулярное выражение для всех символов кроме перехода строки и в JS работает как часы... В общем, если он берёт абсолютно весь текст до последней ), то почему в MsgBox показывает лишь одну строку, а не все разом?</p>]]></content>
			<author>
				<name><![CDATA[Alex_Lexon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32135</uri>
			</author>
			<updated>2017-11-04T07:10:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120749#p120749</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120737#p120737" />
			<content type="html"><![CDATA[<p><strong>Alex_Lexon</strong>, дак у тебя регулярка берет весь текст до &quot;)&quot;.</p>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2017-11-04T04:21:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120737#p120737</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Нужные фрагменты текста с помощью RegExMatch`a]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120732#p120732" />
			<content type="html"><![CDATA[<p>Здравствуйте! Нуждаюсь в помощи с RegExMatch`ем.<br />Код следующий:<br /></p><div class="codebox"><pre><code>FileRead, asd, asd.txt
RegExMatch(asd, &quot;(.*)\)&quot;, asdDva)
MsgBox,,,%asdDva1%
MsgBox,,,%asdDva2%</code></pre></div><p>Файл asd:<br /></p><div class="codebox"><pre><code>Компьютерные системы
10:05 - 10:50IT ; Пушкин; Дятлово - A111 (Осно)
10:05 - 10:50IT ; Грибоедов; Дятлово - B407 (Осно)
11:00 - 11:45IT ; Пушкин; Дятлово - A111 (Осно)
11:00 - 11:45IT ; Грибоедов; Дятлово - B407 (Осно)</code></pre></div><p>Для меня не понятно, почему asdDva2 остаётся пустой, если 4 строки подходят по условиям.</p>]]></content>
			<author>
				<name><![CDATA[Alex_Lexon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32135</uri>
			</author>
			<updated>2017-11-03T22:04:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120732#p120732</id>
		</entry>
</feed>
