- or download this
my $inLine = "RPC, rpc #001b, (1987)";
my $year;
if ($inLine =~ /\((\d+)\)/) {
...
die "No year found in '$inLine'.\n";
}
print "Found year '$year' in '$inLine'.\n";
- or download this
my $inLine = "RPC, rpc #001b, 1987";
$inLine =~ /(#\d+[a-z])/;
...
$inLine =~ /\((\d+)\)/;
my $year = $1;
print "Found year '$year' in '$inLine'.\n";
- or download this
Found rpc num #001b in RPC, rpc #001b, 1987.
Found year #001b in RPC, rpc #001b, 1987.