my $var = "This is the year 2000."; my @matches = ($var =~ /([0-9]{4})/g);