<?xml version="1.0" encoding="windows-1252"?>
<node id="762920" title="Re: Regex bug in 5.10 (was: Using Look-ahead and Look-behind)" created="2009-05-08 15:47:34" updated="2009-05-08 15:47:34">
<type id="11">
note</type>
<author id="665947">
jds17</author>
<data>
<field name="doctext">
You are right, my change did not affect greediness. The bad thing is: now I don't understand why my proposed solution worked at all. Maybe someone can explain? I don't think the question is too important, but I like to use regular expressions and it bugs me a little if I cannot understand one (especially such a tiny one).&lt;p&gt;I have read the documentation you have cited and it helped, so I played around some more and tried out the following, which only exchanges "+" for "*" in your original expression, really works as one would think and therefore would be my preferred solution, at least for Perl 5.10:
&lt;code&gt;
$_ = "Hello";
print "$1\n" while /(?=(.+))/g;
&lt;/code&gt;
Output:
&lt;code&gt;
Hello
ello
llo
lo
o
&lt;/code&gt;</field>
<field name="root_node">
518444</field>
<field name="parent_node">
762839</field>
</data>
</node>
