c:\@Work\Perl\monks>perl -wMstrict -le "my $s = 'xxxABCDEyyy'; ;; print qq{captured '$1'} if $s =~ m{ (ABC|ABCD|ABCDE) }xms; " captured 'ABC'