#!/usr/bin/perl use strict; use warnings FATAL => "all"; my $s = "batcatbetnetbitfit"; my $p = "b.t"; my @matches = $s =~ /$p/g; print "@matches\n"; __END__ returns bat bet bit