use strict;
my $str = '2.0 HSD-U 664-999-01 c301036 1251-A 5445
ChanBoard0 233-455-00 c303bb6 1521-A 5445
ChanBoard1 321-493-00 c303496 1321-A 5445
6.0 DC-07 888-375-02 0C31F8F1 1330-A 5445
aka: 604-375-00
DC-07 123-456-01 0C6203EF 1150-A 5445
aka: 939-420-00
7.0 DC-07 613-493-00 c303496 1321-A 5445
aka: 466-456-65
DC-07 613-493-00 c303496 1321-A 5545';
my $regex = qr/^[\d\.]+\s+(\S+)/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