if ($content =~ /\b($par1)(\W+(\w+\W+){0,$distance})($par2)\b/i) {