sub fmatch {
local($A, $B) = @_;
local($l) = (length($A) < length($B)) ? length($A) : length($B);
local($m) = 0;
local($w) = 2;
local($k);

$A eq $B && return(1.0);
$l > $w || return(0.0);

for $k(0..$l-$w) { 
  local($s) = substr($A, $k, $w);
  #---escape r.e. characters in string A---
  $s =~ s/([()[\]*|?.{}\\])/\\$1/;
  $B =~ $s && $m++;
  }

($m/($l-$w) > 0.80) ? 1 : 0;
}

