#!/usr/local/bin/perl use strict; use warnings; my $match = "sfajdsllllllllllbhafdssss"; print "Yes...Working.." if ($match !~ m#(ah|bh)#gi);