note
chipmunk
Okay.... I was quite close with my original solution, but failed to fully test it. MeowChow pointed out the error in my approach; <code>{$n,$m}</code> will only match once, whereas I need it to match the whole range from $n to $m.
<p>
So, I just needed to add another loop, and voila:
<code>sub repeated {
($_,$t,$n,$m,@p)=@_;
for$i($n..$m){$t=~$1&&push@p,$&while/\b(?=((\w+\b ?){$i}))/g}@p
}
</code>
So that's 83 characters long, with help from [id://79446|MeowChow's solution].
79364
79364