## is the .+ necessary after bb? if( $hit =~ /%(?:ff|jj|bb)/ ) ## alternate version if( $hit =~ /%[fjb]\1\b/ )