use strict;
my $str = 'TRAFFIC MEASUREMENT REPORT PART 1/ 6 VLR MEASUREMENT VLRMEAS
SAMPLE DATE: FROM 2020-10-22 14:00:00:09
TO 2020-10-22 15:00:00:13
REGISTERED SUBSCRIBERS:
LOCATION AREA CODE CURRENT AVERAGE TMS1 TMS2 TMS3
UNKNOWN LAC 2 2 0 0 0
113 75868 75749 0 0 0
115 40627 40732 0 0 0
1102 70422 70489 0 0 0
1105 87075 87067 0 0 0
1117 56150 56180 0 0 0
1118 67175 67444 0 0 0
1120 74385 74381 0 0 0
1121 65034 65060 0 0 0
1122 21636 21407 0 0 0
1217 22944 22856 0 0 0
1218 49054 48993 0 0 0
1318 24283 24066 0 0 0
1418 16366 16350 0 0 0
2118 17812 17674 0 0 0
2120 79644 79489 0 0 0
TOTAL 768477 767939 0 0 0
PART 1/ 6
END OF REPORT
testing some data
here
TRAFFIC MEASUREMENT REPORT PART 2/ 6 VLR MEASUREMENT VLRMEAS
SAMPLE DATE: FROM 2020-10-22 14:00:00:09
TO 2020-10-22 15:00:00:13
REGISTERED SUBSCRIBERS:
LOCATION AREA CODE CURRENT AVERAGE TMS1 TMS2 TMS3
UNKNOWN LAC 2 2 0 0 0
113 75868 75749 0 0 0
115 40627 40732 0 0 0
1102 70422 70489 0 0 0
1105 87075 87067 0 0 0
1117 56150 56180 0 0 0
1118 67175 67444 0 0 0
1120 74385 74381 0 0 0
1121 65034 65060 0 0 0
1122 21636 21407 0 0 0
1217 22944 22856 0 0 0
1218 49054 48993 0 0 0
1318 24283 24066 0 0 0
1418 16366 16350 0 0 0
2118 17812 17674 0 0 0
2120 79644 79489 0 0 0
TOTAL 768477 767939 0 0 0
PART 2/ 6
END OF REPORT';
my $regex = qr`^.*\d/\h*\d.*(?:\R(?!END OF REPORT).*)*\REND OF REPORT\b`mip;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html