c:\@Work\Perl\monks>perl -wMstrict -le "for my $string (qw(abcdef ABCDEF xyzzy)) { my ($extracted) = ($string =~ m/cde|ABC/g, 'nothing'); print qq{from '$string' got '$extracted'}; } " from 'abcdef' got 'cde' from 'ABCDEF' got 'ABC' from 'xyzzy' got 'nothing'