$av_tmp_STRING = "xxx
xxxxxxxxx"; if ( $av_tmp_STRING =~ m/<(?!strong>)(?!pre)/ ) { #do something with the string which contains wrong patterns }