in reply to Quantified named captures in 5.10
I came up with this relatively short snippet that expresses what you want to do, and is generic enough to be extensible, yet legible (Uses 2-stages of RE extraction, and does not require you to pre-define the number of elements you expect to extract ):
my $str = 'Digits: 123689'; print join ',', m/(\d)/g for $str =~ m{Digits: \s* (\d+) }x ; #prints: #1,2,3,6,8,9
"As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom
|
|---|