in reply to String Matching

You only have to globally match each sequence of consecutive digits. A global match (in list context) returns all its matches, so this would do
my $line1 = "[HAVE 1324,2,32,324,5,643]"; my $line2 = "[HAVE 4,213,5432,4]"; for ( $line1, $line2 ) { my @numbers = /\d+/g; print "@numbers\n"; }
Anno