c:\@Work\Perl\monks>perl -wMstrict -le "for my $d ('aaaa 987', 'no joy',) { printf qq{'$d': }; if (my ($x, $y) = $d =~ m{ \A (a+) \s+ (\d+) \z }xms) { print qq{match: x is '$x'; y is '$y'}; } else { print 'no match'; } } " 'aaaa 987': match: x is 'aaaa'; y is '987' 'no joy': no match