<?xml version="1.0" encoding="windows-1252"?>
<node id="812704" title="Re^2: Searchin' through values" created="2009-12-14 08:08:18" updated="2009-12-14 08:08:18">
<type id="11">
note</type>
<author id="763880">
vitoco</author>
<data>
<field name="doctext">
&lt;p&gt;I found very interesting this piece of code as an example for the &lt;c&gt;\G&lt;/c&gt; pattern, but I noticed that &lt;c&gt;x&lt;/c&gt; modifier was missing on each regexp AFAIK, but then tested if there was anything else I'm not awared.&lt;/p&gt;
&lt;p&gt;Just as it is, it returns nothing on &lt;c&gt;$pat&lt;/c&gt;. Then added the &lt;c&gt;x&lt;/c&gt; modifier and got an endless loop!&lt;/p&gt;
&lt;p&gt;I thought it was related to a note in [doc://perlre#Assertions|perlre]: "&lt;i&gt;It is worth noting that &lt;c&gt;\G&lt;/c&gt; improperly used can result in an infinite loop.&lt;/i&gt;", but a small trace using &lt;c&gt;print "($pat)\n";&lt;/c&gt; just before each &lt;c&gt;redo&lt;/c&gt; shows that &lt;c&gt;\G&lt;/c&gt; is always at the beginning of the argument, not after what was already matched.&lt;/p&gt;
&lt;p&gt;I tried again removing &lt;c&gt;pos()&lt;/c&gt; to see if that function resets the pointer... No luck!&lt;/p&gt;
&lt;p&gt;Am I doing something wrong?&lt;/p&gt;
</field>
<field name="root_node">
812624</field>
<field name="parent_node">
812628</field>
</data>
</node>
