<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>www.ritlabs.com [Topic: Problems with subpatterns in regex]</title>
		<link>http://www.ritlabs.com</link>
		<description>New posts in Problems with subpatterns in regex of  forum at www.ritlabs.com [www.ritlabs.com]</description>
		<language>en</language>
		<docs>http://backend.userland.com/rss2</docs>
		<lastBuildDateTag>Thu, 05 Oct 2017 11:59:32 +0300</lastBuildDateTag>		<item>
			<title>Problems with subpatterns in regex</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum6/topic13169/message44843/">Problems with subpatterns in regex</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum6/">The Bat! - Templates and Macros</a>. <br />
			Thanks Daniel. It's interesting that the examples use both %SUBPATT=&quot;1&quot; and %SUBPATT(1) syntax. As far as I can see, only the former is legal, and trying out the latter doesn't work. The examples are all fairly old, and I suspect that the macro language syntax has changed since 2011.<br /><br />So I still don't have a solution. <img src="http://www.ritlabs.com/bitrix/images/main/smiles/5/icon_cry.gif" border="0" data-code=":cry:" data-definition="SD" alt=":cry:" style="width:16px;height:16px;" title="" class="bx-smile" /> &nbsp; <br />
			<i>05 October 2017 11:59:32, <a href="http://www.ritlabs.com/en/forums/">Peter Toye</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum6/topic13169/message44843/</link>
			<guid>http://www.ritlabs.com/en/forums/forum6/topic13169/message44843/</guid>
			<pubDate>Thu, 05 Oct 2017 11:59:32 +0300</pubDate>
			<category>The Bat! - Templates and Macros</category>
		</item>
		<item>
			<title>Problems with subpatterns in regex</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum6/topic13169/message44840/">Problems with subpatterns in regex</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum6/">The Bat! - Templates and Macros</a>. <br />
			Regular Expressions are like Chinese to me, but shouldn't you use <B>%SUBPATT(1)</B> instead of <B>%SUBPATT="1"</B> ?<br /><br />I'm only suggesting this because that's how I see it used in some other topics on this subject: (<noindex><a href="https://www.ritlabs.com/en/auth-forums/forum6/topic4587/" target="_blank" rel="nofollow">1</a></noindex>) (<noindex><a href="https://www.ritlabs.com/en/auth-forums/forum4/topic9866/" target="_blank" rel="nofollow">2</a></noindex>). Those two may be worth a look even if my suggestion doesn't make any sense - they contain some sample scripts similar in function to what you are trying to do. <br />
			<i>04 October 2017 13:10:52, <a href="http://www.ritlabs.com/en/forums/">Daniel van Rooijen</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum6/topic13169/message44840/</link>
			<guid>http://www.ritlabs.com/en/forums/forum6/topic13169/message44840/</guid>
			<pubDate>Wed, 04 Oct 2017 13:10:52 +0300</pubDate>
			<category>The Bat! - Templates and Macros</category>
		</item>
		<item>
			<title>Problems with subpatterns in regex</title>
			<description><![CDATA[<b><a href="http://www.ritlabs.com/en/forums/forum6/topic13169/message44839/">Problems with subpatterns in regex</a></b> in forum <a href="http://www.ritlabs.com/en/forums/forum6/">The Bat! - Templates and Macros</a>. <br />
			I'm trying to do what should be a simple job, but The Bat macro processing doesn't seem to be working as I'd expect. It's probably my understanding of the rather convoluted syntax of the macro language.<br /><br />I've set up a regex to extract some text from the To: list. This includes a pair of brackets to produce a subpattern, But although the match succeeds, the subpattern is always null.<br /><br />The macro code is: <br />
====code====
<pre>%SETPATTREGEXP="(?i)&#92;s*(&#91;^,&#93;*@xxxx&#92;.com&#91;^,&#93;*)&#91;,$&#93;?"%-
Match is :%REGEXPMATCH="%OTOLIST": end of match%-
%_Patt='%SUBPATT="1"'%-
Subpattern is :%_Patt:</pre>
=============
The output is :<br />
====code====
<pre>Match is :XXXX XXXX&nbsp;&nbsp;&#60;XXXX@xxxx.com&#62;: end of match

Subpattern is ::

</pre>
=============
Even if I put '0' instead of &nbsp;'1' for the SUBPATT argument I still get nothing, so I can only assume that either I'm using the wrong syntax for the call to %SUBPATT or the sub patterns aren't being set. I've tested this on a regex tester and the subpattern is picked up OK.<br /><br />Anyone got any ideas how to mend this?<br /><br />Thanks in advance<br /><br />Peter <br />
			<i>04 October 2017 12:06:15, <a href="http://www.ritlabs.com/en/forums/">Peter Toye</a>.</i>]]></description>
			<link>http://www.ritlabs.com/en/forums/forum6/topic13169/message44839/</link>
			<guid>http://www.ritlabs.com/en/forums/forum6/topic13169/message44839/</guid>
			<pubDate>Wed, 04 Oct 2017 12:06:15 +0300</pubDate>
			<category>The Bat! - Templates and Macros</category>
		</item>
	</channel>
</rss>
