Help for this page

Select Code to Download


  1. or download this
    sub hamming {
      my ($x1, $x2) = @_;
    ...
    1
    -1
    3
    
  2. or download this
    # untested
    my $target = "abcdef";
    ...
    
    my $len = length $target;
    my $qr  = qr/ \b(\w{$target})\b (?(??{ hamming($target,$1) < $distance
    + }) | (?!))  /x