print $_, "\n", m[([12])(?:.{7}\1){3}]s ? 'matched' : 'failed' for $a, $b, $c, $d;; 220021 000200 020222 020222 failed 100000 010000 001000 000100 matched 102000 010200 001020 000102 matched 102000 010200 001020 000201 failed