in reply to regexp match repetition breaks in Perl
- Millerwhile ($text =~ m/(APCs?)((?:\s|,|and|\d{3})+)/xgc) { my ($apc, $nums) = ($1, $2); my @nums = $nums =~ m/(\d+)/g; push @extracts, $apc, @nums; } for my $n (0..$#extracts) { print "Match $n = $extracts[$n]\n"; }
while (my @match = $text =~ m/(APCs?)(?:(?:\s|,|and)+(\d{3}))+/xgc) { push @extracts, @match; }
|
|---|