<?xml version="1.0" encoding="windows-1252"?>
<node id="1018574" title="Re^2: A regex that only matches at offset that are multiples of a given N? (Update:almost perfect!)" created="2013-02-13 11:39:26" updated="2013-02-13 11:39:26">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;Ah! &lt;i&gt;Almost(*)&lt;/i&gt; perfect. (I never have wrapped my brain around \G :( )
&lt;code&gt;
print "$-[0]: $1" while $a =~ m[\G(?:.{4})*?(?=(aa..))]g;;
0: aawx
404: aawx

print "$-[0]: $1" while $a =~ m[\G(?:.{4})*?(?=(gg..))]g;;
0: gghn
208: gghn
&lt;/code&gt;

&lt;p&gt;(*)I wasn't seeing the double matching; but now I am. Then I thought moving the \G would fix it, but it doesn't :( )




&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1018488</field>
<field name="parent_node">
1018517</field>
</data>
</node>
