in reply to capturing multiple repeated regex subparts
In addition to the other solutions posted, you can break up the regex using /g and \G and do the looping yourself.
my @submatch; { $str =~ /(text);/g or last; push @submatch, $1; for( 1 .. 4 ) { $str =~ /\G(?:(float)[non-num])/g or do { @submatch = (); last; } push @submatch, $1; } }
Makeshifts last the longest.
|
|---|