#!/usr/bin/perl -w use strict; my @test_strings = ("One flew over the cuckoo's nest", "1 flew over the cuckoo's nest"); foreach my $match_string (@test_strings) { if ($match_string =~ /\d+/) { print "My matching string is\: $match_string\n"; } }