use strict;
my $str = 'ID.4 ESTATE 109kW City Pure 52kWh 5dr Auto
XC40 DIESEL ESTATE 2.0 D4 [190] Inscription Pro 5dr AWD Gea+
RAPID DIESEL HATCHBACK 1.6 TDI CR Elegance 5dr
MODEL 3 120kW LONG RANGE AWD
V40 DIESEL HATCHBACK D2 [120] Momentum 5dr Geartronic
V60 DIESEL SPORTSWAGON 2.0 D4 [190] R DESIGN Plus 5dr Auto
X3 ESTATE xDrive M40i 5dr Auto
C CLASS DIESEL SALOON C250 BlueTEC SE 4dr Auto
A CLASS DIESEL HATCHBACK A180d Sport Executive 5dr Auto
2 SERIES COUPE 218i Sport 2dr [Nav] Step Auto
HILUX SPECIAL EDITIONS Invincible X Ltd Ed D/Cab P/Up 2.4 D+
C3 PICASSO 1.6 BlueHDi Platinum 5dr
C3 HATCHBACK 1.2 PureTech 82 Flair 5dr
XC40 DIESEL ESTATE XC40
1';
my $regex = qr/^[A-Z\d](?:(?!\d+\.\d)[A-Z\d.\h])*[A-Z]{3,}/mp;
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