I have a file that looks like
aaa111bbb
ab01ac d ab02ac ab03ac
aaa222bbb
ab04acab05ac r ab06ac
aaa333bbb
ab01ac t cab06acab10ac
I need to extract the number between 'aaa' and 'bbb' and then pick the following line and extract all numbers between 'ab' and 'ac'
Output would be:
111
01,02,03
222
04,05,06
333
01,06,10
My basic regex is:
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;