$matched = 0; $pmin = -1; $pmax = 0; foreach $namepart (@names) { if (/$namepart/gc) { $matched++; $pmin = pos($_) - length($namepart) if ($pmin == -1); $pmax = pos($_); } } $success = int($matched/($#names+1) * 100); $goodness = int(($pmax - $pmin) / $len * 100); $goodness = 0 if (!$success);
In reply to Inexact Matcher by Odud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |