use strict; use warnings; my $pat1 = qr/(?field)/; my $pat2 = qr/(?f.i.e.l.d)/; my $pat3 = qr/(?the)/; my $str = "There are many soccer fields in England - f1i2e3l4d"; while ( $str =~ m/($pat1|$pat2|$pat3)/ig ) { print "Found '$1' from pattern ", keys %+, "\n"; }