- or download this
$elem[0] = "SHAPES GREEN1;SIZE 240 500 340 930;SIZE 350 500 240 590;SI
+ZE 295 390 015 490;SIZE 350 210 760 300;";
$elem[1] = "SHAPES GREEN2;SIZE 450 310 680 690;SIZE 450 110 680 490;SI
+ZE 215 800 560 900;";
- or download this
my @matches = ( $inp_line =~ /(SHAPES \w+;(?:SIZE[ \d+])+;)/g );
- or download this
my @matches;
for ( @inp_lines ) {
push @matches, ( /(SHAPES \w+;(?:SIZE[ \d+])+;)/g );
}
- or download this
s/(?<=\d;)(?=SHAPES )/\n/; # using "look-behind" and "look-ahead
# now just split on "\n"...