<?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=11817&amp;type=atom" />
	<updated>2016-07-17T23:52:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11817</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение числа из текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106138#p106138" />
			<content type="html"><![CDATA[<p>&quot;\D&quot; - точно, убрать все нецифры - самое простое. *UCP - про это знаю.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2016-07-17T23:52:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106138#p106138</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение числа из текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106137#p106137" />
			<content type="html"><![CDATA[<p>Можно так:<br /></p><div class="codebox"><pre><code>MsgBox % RegexReplace(mytext, &quot;.*?(\d+).*&quot;, &quot;$1&quot;)
MsgBox % RegExReplace(mytext, &quot;\D&quot;)</code></pre></div><p>А чтобы для кириллицы работала \b нужно вставить (*UCP).<br /><a href="https://autohotkey.com/docs/misc/RegEx-QuickRef.htm#Options">https://autohotkey.com/docs/misc/RegEx- … tm#Options</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-07-17T22:39:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106137#p106137</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение числа из текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106135#p106135" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong><br />Более того, я добавил сейчас ещё .* спереди. Без того и другого остаётся проблема с обрезкой числа. Это какой-то баг AHK. Число, судя по примерам, всегда идёт либо после пробела либо в начале текста. Поэтому ошибки не будет.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2016-07-17T20:48:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106135#p106135</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение числа из текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106133#p106133" />
			<content type="html"><![CDATA[<p>Спасибо за помощь.</p>]]></content>
			<author>
				<name><![CDATA[tsarsky]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33686</uri>
			</author>
			<updated>2016-07-17T18:53:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106133#p106133</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение числа из текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106132#p106132" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>MsgBox % RegexReplace(mytext, &quot;\b(\d+).*&quot;, &quot;$1&quot;)</p></blockquote></div><p>А для чего тут \b?<br />При том с кириллицей \b не работает.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2016-07-17T18:45:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106132#p106132</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Отделение числа из текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106131#p106131" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>; Так:
RegexMatch(mytext, &quot;(\d+)&quot;, match)
MsgBox % match1
; Или так:
MsgBox % RegexReplace(mytext, &quot;.*\b(\d+).*&quot;, &quot;$1&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2016-07-17T18:33:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106131#p106131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Отделение числа из текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106130#p106130" />
			<content type="html"><![CDATA[<p>Всем привет! Пишу скрипт и понадобился такой приём, как работа с динамическим текстом. Текст записывается в перемённую, а в тексте хранится какое-нибудь число. Как можно получить это число?</p><p>Примеры:<br /></p><div class="codebox"><pre><code>mytext := &quot;Привет, мне 20 пончиков.&quot;</code></pre></div><div class="codebox"><pre><code>mytext := &quot;Давай ровно 5.&quot;</code></pre></div><div class="codebox"><pre><code>mytext := &quot;15 минут.&quot;</code></pre></div><p>Как итог, то из первого примера нужно вытянуть число 20, из второго число 5 и из последнего число 15.</p>]]></content>
			<author>
				<name><![CDATA[tsarsky]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33686</uri>
			</author>
			<updated>2016-07-17T18:10:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106130#p106130</id>
		</entry>
</feed>
