##
111
01,02,03
222
04,05,06
333
01,06,10
####
use strict;
use warnings;
my $start = 'aaa';
my $end = 'bbb';
my $start1 = 'ab';
my $end1 = 'ac';
my @matches = $content =~ /${start}([0-9]{3})${end}.*?${start1}([0-9]{2})${end1}/smg;