$data = '[-3|1|29x250+46+26|200+300+464|Get][-3|1|29x250+46+26|132+100+244|come][-3|1|29x250+46+26|220+124+432|Go][...][...]'
I need the output as
$val1 = 200
$val2 = 300
$val3 = 464
etc.,
####
my $data = '[-3|1|29x250+46+26|200+300+444|Get][-3|1|29x250+46+26|200+300+444|Get][-3|1|29x250+46+26|200+300+444|Get]';
my $REGEX_COLLECTION = '(\[.*?\])';
my $REGEX_TEXT_RESPONSE = '\[(.*?)\|(.*?)\|(\d+)x(\d+)\+(\d+)\+(\d+)\|(\d+)\+(\d+)\+(\d+)|(.*?)\]';
my @splits = split( $REGEX_COLLECTION, $data );
foreach (@splits)
{
print "The split value is $_ \n";
if ( $_ =~ m/$REGEX_TEXT_RESPONSE/g ) {
print "The first split is $1 \n";
print "The second split is $2 \n";
print "The tird split is $3 \n";
print "The fourth split is $4 \n";
print "The fifth split is $5 \n";
print "The sixth split is $6 \n";
print "The seven split is $7 \n";
print "The eight split is $8 \n";
print "The nine split is $9 \n";
print "The tenth split is $10 \n"
}
}
####
The split value is
The split value is [-3|1|29x250+46+26|200+300+444|Get]
The first split is -3
The second split is 1
The tird split is 29
The fourth split is 250
The fifth split is 46
The sixth split is 26
The seven split is 200
The eight split is 300
The nine split is 444
The tenth split is
The split value is
The split value is [-3|1|29x250+46+26|200+300+444|Get]
The first split is -3
The second split is 1
The tird split is 29
The fourth split is 250
The fifth split is 46
The sixth split is 26
The seven split is 200
The eight split is 300
The nine split is 444
The tenth split is
The split value is
The split value is [-3|1|29x250+46+26|200+300+444|Get]
The first split is -3
The second split is 1
The tird split is 29
The fourth split is 250
The fifth split is 46
The sixth split is 26
The seven split is 200
The eight split is 300
The nine split is 444
The tenth split is