my $word = 'match'; my $string = 'Hatch a plan to watch this RE match'; my @match_re; for my $offset( 0..length($word)-1 ) { my $possibility = $word; # replace one char with . to match anything substr $possibility, $offset, 1, '.'; push @match_re, $possibility; } my $match_re = join '|', @match_re; print "The match RE is qr/$match_re/\n"; $match_re = qr/($match_re)/; my @matches = $string =~ m/$match_re/g; print "Found @matches\n" if @matches; __DATA__ The match RE is qr/.atch|m.tch|ma.ch|mat.h|matc./ Found Hatch watch match