note
kennethk
The quantifier actually makes it match every group; however, it only stores the last match in $1, and thus that's what you see in your return. See [doc://perlretut#Extracting-matches] in [doc://perlretut]. <p>If you want to extract an arbitrary number of digits sandwiched between decimal points, you can grab them all, and then split the result.
<c>/((?:\d+\.)+)/g;
split /(?<=\.)/, $1;
</c>
Alternatively, <blockquote>[i]n list context, //g returns a list of matched groupings, or if there are no groupings, a list of matches to the whole regexp</blockquote>
(see [doc://perlretut#Global-matching] in [doc://perlretut]) so you could try
<c>
my @res = /(?<=\.)\d+\./g;
</c>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-712372">
<hr />
<p>#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.</p>
</div></div>
1039811
1039828